Ubuntu的ssh

安装ssh

sudo apt-get update
sudo apt-get install openssh-server
检测ssh是否启动
sudo ps -e|grep ssh

创建root用户

sudo passwd root

配置本机无密码ssh登录

cd /home/spark0
ssh-keygen -t rsa -P ""
cat .ssh/id_rsa.pub >> .ssh/authorized_keys
chmod 600 .ssh/authorized_keys

spark0免密码ssh登录spark1

在spark1上操作,方法即是将spark0上的公共秘钥加入spark1中
scp [email protected]:/home/spark0/.ssh/id_rsa.pub /home/saprk1
cat /home/spark1/id_rsa.pub >> .ssh/authorized_keys
rm /home/spark1/id_rsa.pub

spark1免密码ssh登录spark0

在spark0上操作
scp [email protected]:/home/spark1/.ssh/authorized_keys ./ssh/
登录
ssh [email protected]

你可能感兴趣的:(Ubuntu的ssh)