When I run the chmod g+s /var/www/
, it will suddenly logout my user..
but I was able to run the command chmod g+r /var/www/
without happened force log out..
I had tried different directory/user/root.. it seem to have same behaviour..
How can I debug this problem ??
I had tried to log my auth.log.. tail -n300 /var/log/auth.log | grep ssh
.
it's seem like everything is normal..
I am try using ssh -vvv example.com
..
here is my debug logs after run the chmod g+s test/
zigang@example.com:~$ chmod g+s test/
zigang@example.com:~$ debug3: receive packet: type 96
debug2: channel 0: rcvd eof
debug2: channel 0: output open -> drain
debug2: channel 0: obuf empty
debug2: channel 0: chan_shutdown_write (i0 o1 sock -1 wfd 5 efd 6 [write])
debug2: channel 0: output drain -> closed
debug3: receive packet: type 98
debug1: client_input_channel_req: channel 0 rtype exit-signal reply 0
debug3: receive packet: type 98
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug2: channel 0: rcvd eow
debug2: channel 0: chan_shutdown_read (i0 o3 sock -1 wfd 4 efd 6 [write])
debug2: channel 0: input open -> closed
debug3: receive packet: type 97
debug2: channel 0: rcvd close
debug3: channel 0: will not send data after close
debug2: channel 0: almost dead
debug2: channel 0: gc: notify user
debug2: channel 0: gc: user detached
debug2: channel 0: send close
debug3: send packet: type 97
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
#0 client-session (t4 r0 i3/0 o3/0 e[write]/0 fd -1/-1/6 sock -1 cc -1)
debug3: send packet: type 1
debug3: fd 1 is not O_NONBLOCK
Connection to 191.168.0.175 closed.
Transferred: sent 4336, received 5004 bytes, in 11.2 seconds
Bytes per second: sent 388.3, received 448.1
debug1: Exit status -1
logs from sudo journalctl --since="-5 minutes"
Sep 29 11:55:43 example.com sudo[376272]: pam_unix(sudo:session): session opened for user root by zigang(uid=0)
Sep 29 11:55:45 example.com kernel: [UFW BLOCK] IN=eth0 OUT= MAC=00:15:5d:a1:98:04:00:15:5d:00:11:04:08:00 SRC=191.168.0.15 DST=191.168.0.175 LEN=52 TOS=0x02 PREC=0x00 TTL=128 ID=54632 DF PROTO=T>
Sep 29 11:56:02 example.com kernel: [UFW BLOCK] IN=eth0 OUT= MAC=00:15:5d:a1:98:04:00:15:5d:00:11:04:08:00 SRC=191.168.0.15 DST=191.168.0.175 LEN=52 TOS=0x02 PREC=0x00 TTL=128 ID=54636 DF PROTO=T>
Sep 29 11:56:06 example.com sudo[376272]: pam_unix(sudo:session): session closed for user root
Sep 29 11:56:22 example.com sshd[376250]: Received disconnect from 192.168.14.185 port 59923:11: disconnected by user
Sep 29 11:56:22 example.com sshd[376250]: Disconnected from user zigang 192.168.14.185 port 59923
Sep 29 11:56:22 example.com sshd[376164]: pam_unix(sshd:session): session closed for user zigang
Sep 29 11:56:22 example.com systemd[1]: session-99.scope: Succeeded.
Sep 29 11:56:22 example.com systemd-logind[987]: Session 99 logged out. Waiting for processes to exit.
Sep 29 11:56:22 example.com systemd-logind[987]: Removed session 99.
Sep 29 11:56:23 example.com kernel: [UFW BLOCK] IN=eth0 OUT= MAC=00:15:5d:a1:98:04:00:15:5d:00:11:04:08:00 SRC=191.168.0.15 DST=191.168.0.175 LEN=52 TOS=0x02 PREC=0x00 TTL=128 ID=54643 DF PROTO=T>
Sep 29 11:56:24 example.com sshd[376535]: Accepted publickey for zigang from 192.168.14.185 port 59961 ssh2: RSA SHA256:J9nGAkrCD2NDm/IoUI8rKiVPjmBKCy4iqQYRGGiJ3fo
Sep 29 11:56:24 example.com sshd[376535]: pam_unix(sshd:session): session opened for user zigang by (uid=0)
Sep 29 11:56:24 example.com systemd-logind[987]: New session 100 of user zigang.
Sep 29 11:56:24 example.com systemd[1]: Started Session 100 of user zigang.
Sep 29 11:56:30 example.com sudo[376655]: pam_unix(sudo:auth): Couldn't open /etc/securetty: No such file or directory
Sep 29 11:56:32 example.com sudo[376655]: pam_unix(sudo:auth): Couldn't open /etc/securetty: No such file or directory
Sep 29 11:56:32 example.com sudo[376655]: zigang : TTY=pts/6 ; PWD=/home/zigang ; USER=root ; COMMAND=/usr/bin/journalctl --since=-5 minutes
Sep 29 11:56:32 example.com sudo[376655]: pam_unix(sudo:session): session opened for user root by zigang(uid=0)
my sshd_config from /etc/ssh/sshd_config
Include /etc/ssh/sshd_config.d/*.conf
ChallengeResponseAuthentication no
UsePAM yes
X11Forwarding yes
PrintMotd no
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
PasswordAuthentication no