Linuxネットワークサービスとセキュリティの強化(写真、手順、見ただけ)

ここに画像の説明を挿入
2台のコンピューターがあります。1台はサーバー(Test2)で、もう1台はクライアント(Test1)です。

Test1:

  • IP:20.0.0.11

Test2:

  • IP:20.0.0.12

最初に、サーバー(Test2)にログインして、ログインユーザー権限を設定する必要があります。

[root@ns2 ~]# vi /etc/ssh/sshd_config 
......
AllowUsers root [email protected]			##只允许root和test2用户登录,但test2用户只能在主机IP为20.0.0.11上进行远程登录
......
[root@ns2 ~]# service sshd reload			##重新加载sshd

次に、クライアント(Test1)上のサーバー(Test2)にリモートでログインできます。

[root@ns1 home]# ssh [email protected]
......
re you sure you want to continue connecting (yes/no)? yes						##接受密钥
Warning: Permanently added '20.0.0.12' (ECDSA) to the list of known hosts.
[email protected]'s password: 						##输入密码

[test2@ns2 ~]$								##登录成功

おすすめ

転載: blog.csdn.net/weixin_48190875/article/details/107716485