SSH建立信任关系
测试用户:dev和test
1. 生成SSH密钥,均执行该命令
/usr/bin/ssh-keygen -t rsa
2. 修改目录权限,均执行该命令
chmod -R 700 ~/.ssh
3. 复制公钥文件
cd ~/.ssh
cp id_rsa.pub id_rsa.pub.dev # dev
cp id_rsa.pub id_rsa.pub.test # test
4. 使用ftp工具,将公钥文件互传给对端$HOME/.ssh目录下
5. 生成鉴权文件,均执行该命令
cd ~/.ssh
touch authorized_keys
cat id_rsa.pub.dev id_rsa.pub.test >> authorized_keys
6. 将passphrase导入内存中,均执行该命令
exec /usr/bin/ssh-agent $SHELL
/usr/bin/ssh-add
7. 测试
sftp [email protected] # test
sftp [email protected] # dev
8. 第一次登陆,在.ssh目录下,会自动生成known_hosts
相关推荐
projava 2020-11-14
WanKaShing 2020-11-12
airfish000 2020-09-11
tryfind 2020-09-14
yegen00 2020-09-10
kkaazz 2020-09-03
风语者 2020-09-02
BraveWangDev 2020-08-19
lichuanlong00 2020-08-15
gsl 2020-08-15
pandaphinex 2020-08-09
yhuihon 2020-08-09
CheNorton 2020-08-02
xiangqiao 2020-07-28
hpujsj 2020-07-26
hpujsj 2020-07-26
sshong 2020-07-19
BraveWangDev 2020-07-19
annan 2020-07-18