解決docker中oyente無法安裝openssh-server的問題:
將容器中的/etc/apt/sources.list文件中的內容替換為
deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
之后執行命令
apt-get update
apt-get install openssh-server --fix-missing
若安裝openssh-server時提示下面錯誤:
Reading package lists... Done
Building dependency tree? ? ?
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
openssh-server : Depends: openssh-client (= 1:6.6p1-2ubuntu2.13) but 1:7.5p1-10ubuntu0.1 is to be installed
? ? ? ? ? ? ? ? ? Recommends: ncurses-term but it is not going to be installed
? ? ? ? ? ? ? ? ? Recommends: ssh-import-id but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
則需卸載掉默認安裝的openssh-client(因版本較新,而openssh-server依賴的版本較舊):
sudo apt-get ?autoremove ?openssh-client
然后再重新安裝它們:
sudo apt-get install openssh-client openssh-server
啟動sshd服務:
sudo /etc/init.d/ssh start