Linux免密SSH登录
- SSH工作机制
- SSH免密码登录
一.SSH工作机制
ssh为Secure Shell(安全外壳协议)的缩写。 很多ftp、pop和telnet在本质上都是不安全的。 我们使用的Xshell6就是基于SSH的客户端实现。 SSH的服务端实现为openssh- deamon。
//在linux上使用ssh
ssh root@192.168.33.88
二.SSH免密码登录
生成秘钥: ssh-keygen 把自己的公钥拷给对方:
ssh-copy-id 192.168.33.3
基于ssh的文件拷贝:
scp abc.txt 192.168.33.3:/root
基于ssh的目录拷贝:需要加-r递归拷贝
scp aaa -r 192.168.33.3:/root
远程执行命令:
ssh 192.168.33.3 "echo hello > /root/hello.txt"