Problem: After system reload, install and configure SSH, firewall configuration
#安装install openssh-server
sudo apt install openssh-server-y
Problem encountered:
sudo apt install openssh-server-y
Reading Package List ... Complete
Analyzing Dependency tree for Package
Reading status information ... Complete
There are some software packages that cannot be installed. If you are using a unstable release, this may be
Because the system is not up to the state you requested. There may be some of the software you need in this release
Packages have not been created or they have been removed from the new to (incoming) directory.
The following information may help solve the problem:
The following packages have unsatisfied dependencies:
Openssh-server: Dependence: openssh-client (= 1:7.1p1-4)
Dependencies: Openssh-sftp-server But it will not be installed
Recommendation: Ssh-import-id But it will not be installed
E: Errors cannot be fixed because you want some packages to stay the way they are, which destroys dependencies between packages.
Workaround:
Ubuntu has a openssh-client, so you can get it through
SSH Username@host
To connect to Linux remotely
But to be connected via SSH, the Ubuntu system needs to have openssh-server, which can be
To see if the sshd is not displayed and the Openssh-server is not installed
Available through
sudo apt-get install Openssh-server
To install the Openssh-server, if the successful installation will succeed if you encounter
$ sudo apt install openssh-server-y
Reading Package List ... Complete
Analyzing Dependency tree for Package
Reading status information ... Complete
There are some software packages that cannot be installed. If you are using a unstable release, this may be
Because the system is not up to the state you requested. There may be some of the software you need in this release
Packages have not been created or they have been removed from the new to (incoming) directory.
The following information may help solve the problem:
The following packages have unsatisfied dependencies:
Openssh-server: Dependence: openssh-client (= 1:7.1p1-4)
Dependencies: Openssh-sftp-server But it will not be installed
Recommendation: Ssh-import-id But it will not be installed
E: Errors cannot be fixed because you want some packages to stay the way they are, which destroys dependencies between packages.
This is because, openssh-server is dependent on the Openssh-clien, that Ubuntu did not bring the openssh-client? The original Openssh-clien is dependent on the version of the openssh-server you are installing, and the version you rely on here is
1:7.1p1-4
So to install the corresponding version of the Openssh-clien, to cover out the Ubuntu
PS: Below see the solution that Ubuntu cannot install Openssh-server
Commands for using Ubuntu installation
sudo apt-get install Openssh-server
The following error occurred
There are no available package openssh-server, but it is referenced by other packages.
This may mean that the missing package may have been discarded or could only be found in the labor insurance release source.
E: Package Openssh-server There are no candidates available for installation
Solving method
Command:
Then download the openssh-server with the following command
Command:
sudo apt-get install Openssh-server
That's OK.
Check the SSH service open state
Ps-s | grep ssh
#启用ssh的指令
start ssh service:
#sudo/etc/init.d/ssh start
stop SSH service:
#sudo/etc/init.d/ssh Stop Reboot
SSH service:
#sudo/etc/init.d/ssh Restart
The above is a small set to introduce the ubuntu16.04 under the installation of Openssh-server newspaper rely on the perfect solution (very good), I hope to help you, if you have any questions welcome to my message, small series will promptly reply to everyone!