我在 ubuntu 12.04 中更新 openssh-server 时遇到了困难,我愚蠢地下载了 14.04 的 .deb 文件,当然它不起作用 :/
我试过 sudo apt-get -f install,它只是删除了我的 openssh
以下是安装 openssh 6.6 的输出
vagrant@precise64:~$ sudo dpkg -i openssh-server_6.6p1-2ubuntu1_amd64.deb
Selecting previously unselected package openssh-server.
(Reading database ... 84054 files and directories currently installed.)
Unpacking openssh-server (from openssh-server_6.6p1-2ubuntu1_amd64.deb) ...
dpkg: dependency problems prevent configuration of openssh-server:
openssh-server depends on libc6 (>= 2.17); however:
Version of libc6 on system is 2.15-0ubuntu10.5.
openssh-server depends on libck-connector0 (>= 0.2.1); however:
Package libck-connector0 is not installed.
openssh-server depends on init-system-helpers (>= 1.13~); however:
Package init-system-helpers is not installed.
openssh-server depends on openssh-client (= 1:6.6p1-2ubuntu1); however:
Version of openssh-client on system is 1:5.9p1-5ubuntu1.3.
openssh-server depends on sysv-rc (>= 2.88dsf-24) | file-rc (>= 0.8.16); however:
Version of sysv-rc on system is 2.88dsf-13.10ubuntu11.1.
Package file-rc is not installed.
openssh-server depends on lsb-base (>= 4.1+Debian3); however:
Version of lsb-base on system is 4.0-0ubuntu20.3.
openssh-server depends on openssh-sftp-server; however:
Package openssh-sftp-server is not installed.
dpkg: error processing openssh-server (--install):
dependency problems - leaving unconfigured
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Processing triggers for ufw ...
答案1
您输入的代码:
sudo dpkg -i openssh-server_6.6p1-2ubuntu1_amd64.deb
应该安装 OpenSSH 服务器而不是删除它。无论如何,如果您想以正确的方式安装它,请使用++Ctrl打开终端并输入:AltT
sudo apt-get install openssh-server
它将安装 OpenSSH 服务器,如果已经安装,它将更新它,如果它是最新的,则不会执行任何操作,此外,如果您在使用上述命令时遇到问题,请尝试:
sudo apt-get update
如上所列,Ubuntu 将 OpenSSH-Server 升级到比最新版本更旧的版本,因此要安装最新版本,首先我们需要删除任何现有的旧 OpenSSH-Server,使用++Ctrl调出命令提示符并键入以下内容,在每行后按 Enter:AltT
sudo apt-get remove openssh-server
然后安装最新的
wget http://mirror.aarnet.edu.au/pub/OpenBSD/OpenSSH/portable/openssh-6.6p1.tar.gz
tar -xvf openssh-6.6p1.tar.gz
cd openssh-6.6p1
./configure --prefix=/usr --sysconfdir=/etc/ssh
--with-md5-passwords --with-privsep-path=/var/lib/sshd
sudo make install
现在您应该已经拥有 OpenSSH-Server 6.6 P1,要检查,请在终端中输入:
sshd -V
答案2
这不是原始解决方案,而是一种在 Ubuntu 上获取最新 openssh-server 的变通方法。在终端中执行以下几行:
sudo echo“debhttp://archive.ubuntu.com/ubuntu乌托邦安全宇宙”>> /etc/apt/sources.list
sudo apt-get 更新
sudo apt-get 安装 openssh-server=1:6.6p1-2ubuntu1
答案3
由于我无法发表评论,我遇到了一些问题,与上面的问题相同,但需要采取一些额外的步骤来防止被锁定。
与上述步骤相同:
wget http://mirror.aarnet.edu.au/pub/OpenBSD/OpenSSH/portable/openssh-6.6p1.tar.gz
tar -xvf openssh-6.6p1.tar.gz
cd openssh-6.6p1
./configure --prefix=/usr --sysconfdir=/etc/ssh
--with-md5-passwords --with-privsep-path=/var/lib/sshd
sudo make install
然后确保重新启动 ssh!
sudo service ssh start
解锁并设置为随机密码(您仍然可以获得 .pem 无密码访问权限)
sudo passwd -u ubuntu
sudo passwd ubuntu
答案4
我想使用最新的 OpenSSL (1.0.2a),所以我必须先构建它(在 Ubuntu 12.04 上升级 OpenSSL)。然后我必须帮助 OpenSSH 找出我的本地 ssl 源位于何处(--with-ssl-dir=/usr/local/ssl)。
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords
--with-privsep-path=/var/lib/sshd --with-ssl=/usr/local/ssl/lib
--with-ssl-dir=/usr/local/ssl