ubuntu下如何安装使用SSH
2012-12-11 11:37
639 查看
ubuntu默认并没有安装ssh服务,如果通过ssh链接ubuntu,需要自己手动安装ssh-server。判断是否安装ssh服务,可以通过如下命令进行:
xjj@xjj-desktop:~$ ssh localhost
ssh: connect to host localhost port 22: Connection refused
如上所示,表示没有还没有安装,可以通过apt安装,命令如下:
-desktop:~$ sudo apt-get install openssh-server
xjj@xjj-desktop:~$ sudo apt-get install openssh-server
系统将自动进行安装,安装完成以后,先启动服务:
@xjj-desktop:~$ sudo /etc/init.d/ssh start
xjj@xjj-desktop:~$ sudo /etc/init.d/ssh start
启动后,可以通过如下命令查看服务是否正确启动
@xjj-desktop:~$ ps -e|grep ssh
6212 ? 00:00:00 sshd
xjj@xjj-desktop:~$ ps -e|grep ssh 6212 ? 00:00:00 sshd
如上表示启动ok。注意,ssh默认的端口是22,可以更改端口,更改后先stop,
然后start就可以了。改配置在/etc/ssh/sshd_config下,如下所示。
xjj@xjj-desktop:~$ vi /etc/ssh/sshd_config
# Package generated configuration file
# See the sshd(8) manpage
for details
# What ports, IPs and protocols we listen
for
Port 22
# Package generated configuration file
# See the sshd(8) manpage for details
# What ports, IPs and protocols we listen for
Port 22
最后,应该是连接的时候了。请看如下命令:
xjj@xjj-desktop:~$ ssh exceljava@192.168.158.129
xjj@xjj-desktop:~$ vi /etc/ssh/sshd_config
xjj@xjj-desktop:~$ ssh localhost
ssh: connect to host localhost port 22: Connection refused
如上所示,表示没有还没有安装,可以通过apt安装,命令如下:
-desktop:~$ sudo apt-get install openssh-server
xjj@xjj-desktop:~$ sudo apt-get install openssh-server
系统将自动进行安装,安装完成以后,先启动服务:
@xjj-desktop:~$ sudo /etc/init.d/ssh start
xjj@xjj-desktop:~$ sudo /etc/init.d/ssh start
启动后,可以通过如下命令查看服务是否正确启动
@xjj-desktop:~$ ps -e|grep ssh
6212 ? 00:00:00 sshd
xjj@xjj-desktop:~$ ps -e|grep ssh 6212 ? 00:00:00 sshd
如上表示启动ok。注意,ssh默认的端口是22,可以更改端口,更改后先stop,
然后start就可以了。改配置在/etc/ssh/sshd_config下,如下所示。
xjj@xjj-desktop:~$ vi /etc/ssh/sshd_config
# Package generated configuration file
# See the sshd(8) manpage
for details
# What ports, IPs and protocols we listen
for
Port 22
# Package generated configuration file
# See the sshd(8) manpage for details
# What ports, IPs and protocols we listen for
Port 22
最后,应该是连接的时候了。请看如下命令:
xjj@xjj-desktop:~$ ssh exceljava@192.168.158.129
xjj@xjj-desktop:~$ vi /etc/ssh/sshd_config
相关文章推荐
- ubuntu下如何安装使用SSH
- ubuntu下如何安装使用SSH?
- ubuntu下如何安装使用SSH?
- (转)ubuntu下如何安装使用SSH?
- ubuntu下如何安装使用SSH
- ubuntu下如何安装使用SSH?
- ubuntu下如何安装使用SSH
- ubuntu下如何安装使用SSH?
- ubuntu下如何安装使用SSH?
- ubuntu下如何安装使用SSH
- 《转》ubuntu下如何安装使用SSH?
- ubuntu14.04,该如何分区安装(初学者或不用它作为生成环境使用)?
- Ubuntu上安装和使用SSH,Xming+PuTTY在Windows下远程Linux主机使用图形界面的程序
- Ubuntu下如何设置ssh免密码登录安装
- 如何在Ubuntu系统下安装使用LaTeX
- 如何使用客户端访问安装在ubuntu上的mysql服务器
- ubuntu 安装使用ssh的方法
- windows如何使用ssh登录ubuntu
- ubuntu 安装git以及如何使用(部分内容转载)
- Ubuntu环境下SSH的安装及使用