我为连接两个主机(客户机192.168.4.107和服务器192.168.4.106)创建了ssh键。在客户端机器上,我运行了这个命令,ssh连接工作:
ssh-keygen
ssh-copy-id -i /root/.ssh/id_rsa.pub oracle@192.168.4.106
ssh-keygen -lf /root/.ssh/id_rsa.pub -E md5
MD5:9a:3d:f7:c9:38:91:41:c7:8e:ca:a0:75:a2:51:b5:fm
ssh-keygen -lf /root/.ssh/id_rsa.pub -E sha256
2048 SHA256:9V6hDnLdq7heMYT2S54AHamAo9Bi8eQVa5oNa1dyHuo在服务器上,我已经启用了审计系统,当我运行报表(aureport -i)时,我会收到如下消息:
type=CRYPTO_KEY_USER msg=audit(19/02/2019 12:35:42.590:1145) : pid=12444 uid=root auid=unset ses=unset subj=system_u:system_r:sshd_t:s0-s0:c0.c1023 msg='op=destroy kind=server fp=SHA256:8a:99:38:f8:db:fd:02:52:76:ce:f8:c5:9a:ef:ef:47:98:23:fb:49:bf:c6:4b:de:e3:76:08:9c:f7:33:01:16 direction=? spid=12444 suid=root exe=/usr/sbin/sshd hostname=? addr=? terminal=? res=success'活动的目的是通过审计系统( ssh键)检测用户登录,问题是两个指纹密钥不匹配(跟踪ip不起作用,我在云上工作,ip是公共的,所有用户都是一样的)。
SHA256上指纹密钥的格式与audit.log文件中的Fp格式有本质的区别,在wich格式中写fp键是吗?我哪里错了?谢谢!
发布于 2019-02-20 16:04:33
我解释了我的解决方案,以检测用户在云服务器上的活动变化。有以下要求:
对于修改的检测文件,我遵循以下步骤,下面是一个示例:
ausearch -f
------------
20/02/2019 16:37:00 /home/oracle/.bash_history 2 yes /usr/bin/bash 54321 770770是事件的数量,谢谢,我可以找到会话号:
ausearch -p | grep 770
----------------------
type=SYSCALL msg=audit(20/02/2019 16:37:00.868:770) : arch=x86_64 syscall=open
success=yes exit=3 a0=0x10bd080 a1=O_WRONLY|O_APPEND a2=0x180 a3=0x0 items=1
ppid=8649 pid=8650 auid=oracle uid=oracle gid=oinstall euid=oracle suid=oracle
fsuid=oracle egid=oinstall sgid=oinstall fsgid=oinstall tty=pts1 ses=58
comm=bash exe=/usr/bin/bash subj=unconfined_u:unconfined_r:unconfined_t:s0-
s0:c0.c1023 key=modifica_fil会话号是58,谢谢,我可以找到登录会话的pid。
ausearch -i | grep ses=58
---------------------------
type=LOGIN msg=audit(20/02/2019 16:34:37.366:747) : pid=8646 uid=root
subj=system_u:system_r:sshd_t:s0-s0:c0.c1023 old-auid=unset auid=oracle tty=
(none) old-ses=4294967295 ses=58 res=yes 登录的pid是8646,我可以查看指定用户在var/log/secure中使用的指纹键
cat secure | grep 8646
----------------------
sshd[8646]: Accepted publickey for oracle from 192.168.4.107 port 58892 ssh2:
RSA SHA256:x.x.x.x.xhttps://unix.stackexchange.com/questions/501790
复制相似问题