在Linux系统中,可以通过以下几种方法来查看Telnet登录日志:
/var/log/auth.log(适用于大多数基于Debian的系统)对于大多数基于Debian的系统(如Ubuntu),Telnet登录日志通常记录在/var/log/auth.log文件中。
sudo cat /var/log/auth.log | grep 'sshd'
或者使用grep命令直接过滤出与SSH相关的日志条目:
sudo grep 'sshd' /var/log/auth.log
/var/log/secure(适用于大多数基于Red Hat的系统)对于大多数基于Red Hat的系统(如CentOS、Fedora),Telnet登录日志通常记录在/var/log/secure文件中。
sudo cat /var/log/secure | grep 'sshd'
或者使用grep命令直接过滤出与SSH相关的日志条目:
sudo grep 'sshd' /var/log/secure
journalctl(适用于使用systemd的系统)如果你的系统使用systemd作为初始化系统,可以使用journalctl命令来查看日志。
sudo journalctl -u sshd
last命令last命令可以显示最近登录系统的用户列表,包括Telnet登录。
last
who命令who命令可以显示当前登录系统的用户列表。
who
sudo。/var/log/auth.log.*或/var/log/secure.*文件来查看旧的日志条目。通过以上方法,你应该能够找到并查看Linux系统中的Telnet登录日志。