切断用户连接

who 查看用户连接

断开远程用户:fuser -k /dev/pts/x
x为who下看到的这个用户的pts序号


断开本地用户:fuser -k /dev/ttyx
x为who查看到的tty序号

Linux下查看用户登陆历史记录,可以用root用户下的last命令查看:


[root@DB-Server ~]# su root
[root@DB-Server ~]# last -10
root     pts/1        :0.0             Wed Dec 21 09:54   still logged in   
root     pts/4        :0.0             Wed Dec 21 09:43 - 09:48  (00:04)    
root     pts/1        :0.0             Wed Dec 21 09:43 - 09:48  (00:05)    
root     pts/3        27.196.158.79   Wed Dec 21 09:41 - 12:40  (02:59)    
root     pts/4        :0.0             Wed Dec 21 09:28 - 09:30  (00:01)    
root     pts/3        :0.0             Wed Dec 21 09:27 - 09:30  (00:02)    
root     pts/2        27.196.158.29   Wed Dec 21 09:27   still logged in   
root     pts/1        :0.0             Wed Dec 21 09:27 - 09:42  (00:15)    
root     pts/2        :0.0             Wed Dec 21 09:23 - 09:25  (00:01)    
root     pts/1        :0.0             Wed Dec 21 09:22 - 09:25  (00:02) 
#查看最近10次用户历史操作记录

连接慢

  • ssh 连接慢 使用 ssh -v
ssh -v 192.168.12.43

This is probably an issue with D-Bus and systemd. If the dbus service is restarted for some reason, you will also need to restart systemd-logind.
You can check if this is the issue by opening the ssh daemon log (on Ubuntu it should be /var/log/auth.log) and check if it has these lines:
*注:CentOS 下查看* 

cat /var/log/securesshd[2721]: pam_systemd(sshd:session): Failed to create session: Connection timed out 如果找到以上信息,则在服务端执行: **systemctl restart systemd-logind**