默认远程主机上已经存在 ~/.ssh 目录。在自己PC上执行下面脚本,输入服务器用户名和ip地址,下次登录可实现无密码登录。
#!/bin/bash
id_res_pub=~/.ssh/id_rsa.pub
if [ ! -f "$id_res_pub" ];then
ssh-keygen -t rsa
else
echo "id_rsa.pub is exist!"
fi
ec...
分类:
系统相关 时间:
2015-05-23 10:03:33
阅读次数:
166
步骤1: 用 ssh-key-gen 在本地主机上创建公钥和密钥 ligh@local-host$ ssh-keygen -t ?rsa Enter file in which to save the key (/home/jsmith/.ssh/id_rsa):[Enter key] Enter passphrase (empty for no passp...
分类:
其他好文 时间:
2015-05-21 20:00:41
阅读次数:
169
1.检查是否安装$git --version2.配置$git config --global user.name "name"$git config --global user.email "email@xxx.com"3.创建SSH$ssh-keygen -t rsa -C "email@xxx....
分类:
其他好文 时间:
2015-05-21 12:09:51
阅读次数:
152
照写打一遍就OKcd~rm-rf.sshssh-keygen-trsa-P‘‘cd.sshcatid_rsa.pub>>authorized_keyschmod600authorized_keys一路回车不敲入其他字符执行一个ssh-add
分类:
其他好文 时间:
2015-05-20 18:46:52
阅读次数:
93
1.查看是否已经有了ssh密钥:cd ~/.ssh 如果没有密钥则不会有此文件夹,有则备份删除 2.生存密钥: $ssh-keygen?-t?rsa?-C?"youremail@example.com" 你需要把邮件地址换成你自己的邮件地址,然后一路回车,使...
分类:
系统相关 时间:
2015-05-20 13:22:06
阅读次数:
159
背景:有A、B两台CentOS6.2系统;A:192.168.12.128;B:192.168.12.133;目标:实现A、B设备相互无需密码登陆;过程:一、登陆A设备:#cd/root/.ssh/#ssh-keygen-trsa生成秘钥(id_rsa;id_rsa.pub),过程直接空格;#cpid_rsa.pubauthorized_keys#chmod600authorized_keys#scp..
分类:
其他好文 时间:
2015-05-18 13:09:12
阅读次数:
127
背景:有A、B两台CentOS6.2系统;A:192.168.12.128;B:192.168.12.133;目标:实现A、B设备相互无需密码登陆;过程:一、登陆A设备:#cd/root/.ssh/#ssh-keygen-trsa生成秘钥(id_rsa;id_rsa.pub),过程直接空格;#cpid_rsa.pubauthorized_keys#chmod600authorized_keys#scp..
分类:
其他好文 时间:
2015-05-18 13:09:02
阅读次数:
122
openssh服务注:使用两台主机,一台作测试,一台作服务器服务端:1.安装openssh-server服务yuminstallopenssh-server-y2.打开服务,并且设置开机项systemctlstartsshdsystemctlenablesshd3.ssh服务的key文件①ssh-keygen②使用公钥id_ras.pub给用户加密ssh-copy-id-iid_rsa.pub..
分类:
其他好文 时间:
2015-05-16 18:41:29
阅读次数:
181
1.单向无密钥配置station213->station220:步骤一:输入命令:ssh-keygen一路回车。。[root@station213~]#ssh-keygen
Generatingpublic/privatersakeypair.
Enterfileinwhichtosavethekey(/root/.ssh/id_rsa):
/root/.ssh/id_rsaalreadyexists.
Overwrite(y/n)?步骤二:生成..
分类:
系统相关 时间:
2015-05-14 14:27:41
阅读次数:
256
github使用SSH链接,需要设置SSH1.检查SSH key cd ~/.ssh2.备份已有的key,(如果有的话) mkdir key_backup mv id_rsa* key_backup3.生成SSH key$ ssh-keygen -t rsa -C jonezhang86@gmail...
分类:
系统相关 时间:
2015-05-12 20:35:55
阅读次数:
232