ssh, scp 不输入密码进行操作
系统大全为您提供
通过ssh-keygen生成公钥,在两台机器之间互相建立信任通道即可。
假设本地机器client,远程机器为server。
1. 生成rsa keygen
[winter@client winter] $ ssh-keygen -b 1024 -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/winter/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/winter/.ssh/id_rsa.
Your public key has been saved in /home/winter/.ssh/id_rsa.pub.
The key fingerprint is:
33:d4:7b:9c:87:04:cf:14:40:22:6d:c7:15:78:97:6a winter@client
直接上面公钥和私钥存放地址可以直接回车,私钥密码可以直接回车,也可以输入。
2. 查看.ssh目录下了多私钥和公钥文件
[winter@client winter] $ ls .ssh/
id_rsa id_rsa.pub known_hosts
3. 拷贝公钥到目标机器上,并改名成authorized_keys
[winter@client winter] $ scp .ssh/id_rsa.pub winter@192.168.0.110:/home/winter/.ssh/authorized_keys
The authenticity of host '192.168.0.110(192.168.0.110)' can't be established.
RSA key fingerprint is 5b:78:e8:e9:dc:d8:db:bd:f7:66:44:e6:3b:ce:f2:79.
Are you sure you want to continue connecting (yes)? yes
Warning: Permanently added '192.168.0.110' (RSA) to the list of known hosts.
winter@192.168.0.110's password:
id_rsa.pub 100% 221 1.2MB/s 00:00
首次scp命令时候还是会提示输入密码,还有是否继续链接的提示,以后
4. 测试ssh进入
[winter@client winter] $ ssh 192.168.0.110
5. ok,搞定!
以上就是系统大全给大家介绍的如何使的方法都有一定的了解了吧,好了,如果大家还想了解更多的资讯,那就赶紧点击系统大全官网吧。
本文来自系统大全http://www.win7cn.com/如需转载请注明!推荐:win7纯净版
系统下载排行榜71011xp
番茄花园 Win7 64位 快速稳定版
2【纯净之家】Windows7 64位 最新纯净版
3【老机专用】Windows7 32位 精简旗舰版
4【纯净之家】Windows7 SP1 64位 全补丁旗舰版
5JUJUMAO Win7 64位 最新纯净版
6【纯净之家】Windows7 32位 最新纯净版
7【纯净之家】Windows7 SP1 64位 办公旗舰版
8【雨林木风】Windows7 64位 装机旗舰版
9【电脑公司】Windows7 64位 免费旗舰版
10【国庆献礼】JUJUMAO Win7 SP1 64位旗舰克隆纯净版
【纯净之家】Windows10 22H2 64位 专业工作站版
2【纯净之家】Windows10 22H2 64位 游戏优化版
3【纯净之家】Windows10 企业版 LTSC 2021
4【纯净之家】Windows10企业版LTSC2021 纯净版
5【深度技术】Windows10 64位 专业精简版
6联想Lenovo Windows10 22H2 64位专业版
7JUJUMAO Win8.1 Up3 X64 极速精简版v2019.11
8【纯净之家】Windows10 22H2 64位 专业精简版
9【雨林木风】Windows10 64位 专业精简版
10【纯净之家】Windows10 22H2 64位 专业办公版
【纯净之家】Windows11 23H2 64位 游戏优化版
2【纯净之家】Windows11 23H2 64位 专业工作站版
3【纯净之家】Windows11 23H2 64位 纯净专业版
4风林火山Windows11下载中文版
5【纯净之家】Windows11 23H2 64位 最新企业版
6【纯净之家】Windows11 23H2 64位 中文家庭版
7JUJUMAO Win11 24H2 64位 专业版镜像
8深度精简 Win11 ESD 全新优化纯净版V2024
9【纯净之家】Windows11 23H2 64位专业精简版
10【纯净之家】Windows11 23H2 64位 纯净家庭版
深度技术 GHOST XP SP3 电脑专用版 V2017.03
2深度技术 GGHOST XP SP3 电脑专用版 V2017.02
3Win7系统下载 PCOS技术Ghost WinXP SP3 2017 夏季装机版
4萝卜家园 GHOST XP SP3 万能装机版 V2017.03
5番茄花园 GHOST XP SP3 极速体验版 V2017.03
6雨林木风 GHOST XP SP3 官方旗舰版 V2017.03
7电脑公司 GHOST XP SP3 经典旗舰版 V2017.03
8雨林木风GHOST XP SP3完美纯净版【V201710】已激活
9萝卜家园 GHOST XP SP3 完美装机版 V2016.10
10雨林木风 GHOST XP SP3 精英装机版 V2017.04
热门教程
装机必备 更多+
重装工具