The Way of C++

  C++博客 :: 首页 :: 联系 :: 聚合  :: 管理
  55 Posts :: 0 Stories :: 19 Comments :: 0 Trackbacks

公告

The first time i use this blog, i will write something that i learn which i think is worth write down.

常用链接

留言簿(3)

我参与的团队

搜索

  •  

最新评论

阅读排行榜

评论排行榜

ubuntu默认并没有安装ssh服务,如果通过ssh链接ubuntu,需要自己手动安装ssh-server。判断是否安装ssh服务,可以通过如下命令进行:

  1. xjj@xjj-desktop:~$ ssh localhost  
  2. ssh: connect to host localhost port 22: Connection refused   

如上所示,表示没有还没有安装,可以通过apt安装,命令如下:

  1. xjj@xjj-desktop:~$ sudo apt-get install openssh-server  

系统将自动进行安装,安装完成以后,先启动服务:

  1. xjj@xjj-desktop:~$ sudo /etc/init.d/ssh start  

 

启动后,可以通过如下命令查看服务是否正确启动

  1. xjj@xjj-desktop:~$ ps -e|grep ssh  
  2.  6212 ?        00:00:00 sshd  

 


如上表示启动ok。注意,ssh默认的端口是22,可以更改端口,更改后先stop,
然后start就可以了。改配置在/etc/ssh/sshd_config下,如下所示。

Java代码
  1. xjj@xjj-desktop:~$ vi /etc/ssh/sshd_config  
  2. # Package generated configuration file  
  3. # See the sshd(8) manpage for details  
  4. # What ports, IPs and protocols we listen for  
  5. Port 22  

 


最后,应该是连接的时候了。请看如下命令:

Java代码
xjj@xjj-desktop:~$ ssh exceljava@192.168.158.129
posted on 2010-03-28 18:45 koson 阅读(3589) 评论(0)  编辑 收藏 引用 所属分类: Linux

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理