- 安装ssh服务端
sudo apt-get install openssh-server;
sudo apt-get install ssh
ssh-keygen -t rsa
cd ~/.ssh
cat id_rsa.pub >> authorized_keys
ssh localhost
- 确认ssh服务是否启动
ps -e | grep ssh
如果只有ssh-agent那ssh-server还没有启动,需要/etc/init.d/ssh start
,如果看到sshd那说明ssh-server已经启动了
- 启动sshserver
/etc/init.d/ssh start
- 重启sshserver
/etc/init.d/ssh restart