forked from owen7005/kjyw
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
3 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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添加到主机列表文件中" |