Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ppabc committed Jun 2, 2018
1 parent cb33d7f commit 1bdded2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ssh/ssh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
##robert yu
##centos 6

ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa -q -b 2048 -C "[email protected]"

#ssh无密码认证 RSA
ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
Expand Down Expand Up @@ -46,4 +48,4 @@ ssh root@$ip 'service sshd restart'
hostname=`ssh root@${ip} 'hostname'`
echo "添加主机名和IP到本地/etc/hosts文件中"
echo "$ip $hostname" >> /etc/hosts
echo "远端主机主机名称为$hostname, 请查看 /etc/hosts 确保该主机名和IP添加到主机列表文件中"
echo "远端主机主机名称为$hostname, 请查看 /etc/hosts 确保该主机名和IP添加到主机列表文件中"

0 comments on commit 1bdded2

Please sign in to comment.