Ubuntu下安装SSH

来源:互联网 发布:淘宝客服容易做吗 编辑:程序博客网 时间:2024/05/29 19:39

1.首先检查是否安装SSH

输入命令:ssh localhost.

命令返回:connect to host localhost port 22: Connection refused表示没有安装SSH.

2.安装openssh-server

输入命令:sudo apt-get install openssh-server

3.启动SSH服务

输入命令:sudo /etc/init.d/ssh start

4.查看SSH服务是否启动

输入命令:ps -e |grep ssh

5.其它

ssh-server配置文件位于/etc/ssh/sshd_config,可以自定义SSH的服务端口。
默认端口是22,自定义端口后需重启SSH服务:
sudo /etc/init.d/ssh stop
sudo /etc/init.d/ssh start

登陆SSH:
ssh username@localhost
username为localhost机器上的用户,需要输入密码。

断开连接:
exit


0 0
原创粉丝点击