怎样用命令查找别人用ssh登录自己本地主机
来源:互联网 发布:2018人工智能展览会 编辑:程序博客网 时间:2024/04/30 15:25
ps -ef|grep sshd
root 1693 1 0 Aug13 ? 00:00:00 /usr/sbin/sshd #父进程号是1的是系统服务进程
root 12598 1693 2 14:59 ? 00:00:00 /usr/sbin/sshd #有这个进程说明有SSHD远程客户登录
root 12638 1693 0 15:02 ? 00:00:00 /usr/sbin/sshd #这是第二个登录用户
root 12633 12600 0 14:59 pts/0 00:00:00 grep sshd
二、根据登录上来的进程号找到用户进程
#ps -ef|grep 12598
root 12598 1693 0 14:59 ? 00:00:00 /usr/sbin/sshd
root 12600 12598 0 14:59 pts/0 00:00:00 -bash #第一个用户,居然还是用root登录的。
#ps -ef|grep 12633
root 12638 1693 0 15:02 ? 00:00:00 /usr/sbin/sshd
root 12640 12638 0 15:02 pts/1 00:00:00 -bash #第二个用户
三、根据bash进程的终端号pts/?来确定来源
[root@redhat root]# who -a|grep pts/1
root + pts/1 Aug 14 15:02 00:03 12640 (192.168.0.123) #登录来源IP192.168.0.123
[root@redhat root]# who -a|grep pts/0
root + pts/0 Aug 14 14:59 . 12600 (192.168.0.123) #登录来源IP192.168.0.123
root 1693 1 0 Aug13 ? 00:00:00 /usr/sbin/sshd #父进程号是1的是系统服务进程
root 12598 1693 2 14:59 ? 00:00:00 /usr/sbin/sshd #有这个进程说明有SSHD远程客户登录
root 12638 1693 0 15:02 ? 00:00:00 /usr/sbin/sshd #这是第二个登录用户
root 12633 12600 0 14:59 pts/0 00:00:00 grep sshd
二、根据登录上来的进程号找到用户进程
#ps -ef|grep 12598
root 12598 1693 0 14:59 ? 00:00:00 /usr/sbin/sshd
root 12600 12598 0 14:59 pts/0 00:00:00 -bash #第一个用户,居然还是用root登录的。
#ps -ef|grep 12633
root 12638 1693 0 15:02 ? 00:00:00 /usr/sbin/sshd
root 12640 12638 0 15:02 pts/1 00:00:00 -bash #第二个用户
三、根据bash进程的终端号pts/?来确定来源
[root@redhat root]# who -a|grep pts/1
root + pts/1 Aug 14 15:02 00:03 12640 (192.168.0.123) #登录来源IP192.168.0.123
[root@redhat root]# who -a|grep pts/0
root + pts/0 Aug 14 14:59 . 12600 (192.168.0.123) #登录来源IP192.168.0.123
- 怎样用命令查找别人用ssh登录自己本地主机
- 本地主机SSH免密登录服务器
- 使用expect工具 用ssh命令自动登录远程主机
- ssh 远程主机登录
- ssh 登录到内网主机
- ubuntu14.10下通过ssh命令远程登录云主机
- ssh命令用于远程登录上Linux主机
- ssh无密码登录主机
- Python SSH登录Linux主机
- putty远程登录ssh主机
- 关于ssh远程登录主机
- ssh自动登录主机脚本
- SSH密钥登录远程主机
- 〖Linux〗使用ssh登录远程主机,并在本地打开远程图形界面
- ssh登录不上别人的机器
- Windows下通过SSH使用SharpSSH远程登录主机执行命令传输文件
- ssh无密码登录远程主机执行特定命令的注意事项
- Linux ssh登录命令
- iOS应用程序状态切换相关
- NOJ 42题 一笔画(欧拉回路)
- ffmpeg与RTMP流媒体连接用法
- scheduler(repeat_interval)【每日一译】--2013-01-29
- Hive笔记--安装
- 怎样用命令查找别人用ssh登录自己本地主机
- 线程池实现处理多个连接
- poj 1502 MPI Maelstrom
- 单链表之插入结点
- 2013 年 6 月 RedMonk 编程语言排行榜
- samba的启动与停止
- 升级Hibernate3.5:javax.persistence.OneToMany.orphanRemoval()Z
- ural 1073. Square Country
- HDU 4160 Dolls 匈牙利算法求最大匹配数