View and Check Who Login on SHH Server
View and Check Who Currently Login on SHH Server
The step by step using lsof command to view or check who currently login on SSH server. The step by step article below show the the example using the lsof command on Linux Fedora sever to view and check who currently login on SHH server. Please note that the default setting for SSH server usually listen on port 22, make sure that you edit the port number if you customize the SHH server setting.
To start check SHH server connection, or who is currently login on our Linux Fedora server using SSH connection.. execute command as show on example below.
check SSH connection using port number:
[root@fedora ~]# lsof -i :22
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
sshd 1892 root 3u IPv6 4966 TCP *:ssh (LISTEN)
sshd 1892 root 4u IPv4 4968 TCP *:ssh (LISTEN)
sshd 14382 root 3r IPv4 56404 TCP 172.16.162.125:ssh->172.16.162.60:directvdata (ESTABLISHED)
sshd 14519 root 3r IPv4 59072 TCP 172.16.162.125:ssh->172.16.162.60:wg-netforce (ESTABLISHED)
sshd 14522 fedora 3u IPv4 59072 TCP 172.16.162.125:ssh->172.16.162.60:wg-netforce (ESTABLISHED)
[root@fedora ~]#
or you also can view or check SSH connection using name:
[root@fedora ~]# lsof -i :ssh
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
sshd 1892 root 3u IPv6 4966 TCP *:ssh (LISTEN)
sshd 1892 root 4u IPv4 4968 TCP *:ssh (LISTEN)
sshd 14382 root 3r IPv4 56404 TCP 172.16.162.125:ssh->172.16.162.60:directvdata (ESTABLISHED)
sshd 14519 root 3r IPv4 59072 TCP 172.16.162.125:ssh->172.16.162.60:wg-netforce (ESTABLISHED)
sshd 14522 fedora 3u IPv4 59072 TCP 172.16.162.125:ssh->172.16.162.60:wg-netforce (ESTABLISHED)
[root@fedora ~]#
Troubleshoot:
1. If you cannot execute the lsof command and show "-bash: lsof: command not found" error, as show on example below
[fedora@fedora ~]$ lsof -i :22
-bash: lsof: command not found
[fedora@fedora ~]$
2. You may need to log in as root user or use the su command as show on example below and supply the root user password when ask...
[fedora@fedora ~]$ su - -c "lsof -i :22"
Password:
[fedora@fedora ~]$
3. or
[fedora@fedora ~]$ su - -c "lsof -i :ssh"
Password:
[fedora@fedora ~]$
Keywords: who login ssh server, check who login ssh server, check ssh server, check ssh connection, check who currently login on ssh server, view ssh connection
- Add new comment
- 6365 reads
- Email this page
Thanks for Reading and Check Other Popular Linux Topics
All time:
- Configure and Setup Squid Cache Proxy Server on Fedora Core.
- Using Linux rm command to delete, remove hidden files and folder - Basic Linux Command.
- Copy Linux Files and Copy Directory Using cp Command - Linux Basic Command.
- Moving or rename files and directory using Linux mv command - Basic Linux Command.
- Add, view, edit and configure route and static route on Linux Fedora Core - Linux Server Configuration.
- Get and display the size of file and directory in Linux system using du command.
- Step by step Install Setup and Configure Linux Fedora Core Server and Network Management with Screen Shot and Example.
- Create file and display file contents in Linux using cat command.
- Configure Squid to block HTTP request to specific web sites.
- Example of samba smbpasswd file and samba smbusers configuration file.



Recent comments
5 hours 20 min ago
20 hours 43 min ago
2 days 12 hours ago
4 days 17 hours ago
5 days 2 hours ago
5 weeks 3 days ago
9 weeks 3 days ago
14 weeks 1 day ago
14 weeks 1 day ago
14 weeks 6 days ago