2.配置desktop中的sshd服务要求如下:
*)设定sshd服务只允许westos用户可以被访问使用
*)创建westos用户的key认证方式
*)设定westos用户只允许使用key认证方式,屏蔽其系统密码认证方式
第一问
第二问
设定sshd服务只允许westos用户可以被访问使用
进这个文件修改配置
修改79行,81行。
生成一对钥匙,锁
加密自己的主机(-i 指定加密key文件)
用公钥加密
[root@Nicholas .ssh]# ssh-copy-id -i /root/.ssh/id_rsa.pub westos@192.168.2.115
The authenticity of host '192.168.2.115 (192.168.2.115)' can't be established.
ECDSA key fingerprint is f4:7b:49:a0:d0:c9:e0:27:07:49:9d:5c:24:78:c9:b3.
Are you sure you want to continue connecting (yes/no)? yes
/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
westos@192.168.2.115's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh 'westos@192.168.2.115'"
and check to make sure that only the key(s) you wanted were added.
PasswordAuthentication no ##有秘钥的话,可以不用输入密码
192.128.2.124可以不输入密码的情况下ssh链接我的主机