安装openssh-server报Depends: openssh-client (= 1:6.6p1-2ubuntu2.8)错误

来源:互联网 发布:淘宝主图点击率怎么看 编辑:程序博客网 时间:2024/05/29 04:52

SFTP称作“安全的FTP”,它使用ssh文件传输协议。所以我们需要安装openssh-server


ubuntu自带的有openssh-client,所以可以通过

ssh username@host
来远程连接linux。

可是要想通过ssh被连接,ubuntu系统需要有openssh-server,可以通过如下操作:

1、可是要想通过ssh被连接,ubuntu系统需要有openssh-server,可以通过

ps -e|grep ssh   来查看,

显示如下:

7153 ?        00:00:00 sshd
7222 ?        00:00:00 sshd
7262 ?        00:00:00 sshd

如果没有显示sshd则说明没有安装openssh-server。

2、可通过

sudo apt-get install openssh-server

安装openssh-server,如果顺利的话会安装成功,如果遇到以下问题:

openssh-server : Depends: openssh-client (= 1:6.6p1-2ubuntu2.8)
                  Recommends: ssh-import-id but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

原因如下:

这是因为,openssh-server是依赖于openssh-clien的,那ubuntu不是自带了openssh-client吗?

原由是自带的openssh-clien与所要安装的openssh-server所依赖的版本不同,这里所依赖的版本是:

1:6.6p1-2ubuntu2.8

所以要安装对应版本的openssh-clien,来覆盖掉ubuntu自带的

sudo apt-get install openssh-client=1:6.6p1-2ubuntu1

这样再安装openssh-server就可以成功了。

二、怎么查看Ubuntu的ssh端口:

在 etc/ssh 下面有个 ssh_config的文件使用vim或者vi打开里面有个port 这里就是ssh对外开放的端口如果前面有#代表这个使用的是默认端口如果不想使用默认端口把井号去掉Port xxxx顶头写就行了注意:Port一定要顶头,不能有空格




阅读全文
0 0
原创粉丝点击