安装SSH服务
Ubuntu默认并没有安装ssh服务,如果通过ssh链接ubuntu,需要自己手动安装ssh-server。判断是否安装ssh服务,可以通过如下命令进行:
- ~$ ssh localhost
- ssh: connect to host localhost port 22: Connection refused
如上所示,表示没有还没有安装,可以通过apt安装,命令如下:
- ~$ sudo apt-get install openssh-server
系统将自动进行安装,安装完成以后,先启动服务:
- ~$ sudo /etc/init.d/ssh start
启动后,可以通过如下命令查看服务是否正确启动
- www.linuxidc.com@linuxidc:~$ ps -e|grep ssh
- 39251 ? 00:00:00 sshd
如上表示启动ok。注意,ssh默认的端口是22,可