沙场9

来源:互联网 发布:生命公式软件 编辑:程序博客网 时间:2024/05/18 09:47

unit9

1.desktop主机中建立用户westos,并设定其密码为westoslinux

useradd westos

passwd westos

2.配置desktop中的sshd服务要求如下:

*)设定sshd服务只允许westos用户可以被访问使用

vim /etc/ssh/sshd_config

Allusers westos

systemctl restart sshd

*)创建westos用户的key认证方式

ssh-keygen

ssh-copy-id i /home/westos/.ssh/id_rsa.pub westos@192.168.1.126

scp /home/westos/.ssh/id_rsa root@192.168.1.125:/root/.ssh/

*)设定westos用户只允许使用key认证方式,屏蔽其系统密码认证方式

vim /etc/ssh/sshd_config

更改PasswordAuthentication yes,yes改为no

0 0