Linux之ssh登录
作业三:ssh登录,scp上传、下载,ssh秘钥登录,修改ssh server端的端口为8888然后进行登录和scp测试
1.ssh登录
[root@localhost network-scripts]# systemctl status sshd
2.scp上传、下载
[root@python1 ~]# scp /etc/hosts 192.168.202.13
[root@python1 ~]# ls /tmp/
3.ssh秘钥登录
[root@python1 ~]# ssh-keygen
[root@python1 ~]# ssh-copy-id -i 192.168.202.131
[root@python1 ~]# cd /root/.ssh/
[root@python1 .ssh]# ls
authorized_keys id_rsa id_rsa.pub known_hosts
[root@python1 .ssh]# cat authorized_keys
4.修改ssh server端的端口为8888然后进行登录和scp测试
[root@python1 ~]# vim /etc/ssh/sshd_config
[root@python1 ~]# systemctl restart sshd
[root@python1 ~]# netstat -an
root@python1 .ssh]# ssh python1 -p 8888