apt-get update与ssh server服务安装

来源:互联网 发布:剑三男捏脸数据 编辑:程序博客网 时间:2024/06/07 15:33
更新apt-get命令
sudo apt-get update

更新前替换/etc/apt/sources.list
地址:http://download.csdn.net/detail/kerryzb/9511765


安装ssh server

先判断是否已安装了ssh服务
ssh localhost
如果没有安装会显示:
ssh: connect to host localhost port 22: Connection refused 


安装:

sudo apt-get install openssh-server


启动ssh服务
sudo /etc/init.d/ssh start

启动后,可以通过如下命令查看服务是否正确启动
ps -e|grep ssh
正常启动则显示为:
6212 ?        00:00:00 sshd  

ssh默认的端口是22,可以更改端口,更改后先stop,
然后start就可以了。改配置在/etc/ssh/sshd_config下


安装 sudo apt-get install openssh-server  
可能报错
The following packages have unmet dependencies:
 openssh-server : Depends: openssh-client (= 1:5.9p1-5ubuntu1)
                  Recommends: xauth but it is not going to be installed
                  Recommends: ssh-import-id but it is not going to be installed
解决办法
先装一个依赖的指定版本的 openssh-client (旧版):
sudo apt-get install openssh-client=1:5.9p1-5ubuntu1
0 0