Solve ubuntu install ssh service can not open the package to resolve the problem

   Linux developers need to do SSH powerful support under Windows. SSH installation process will appear a lot of questions after reading this article may make you less take some detours, PS: results of a toss afternoon.

Niubi place Ubuntu's apt-get tool is simply unparalleled, Apt-get is through the application of all available packages have a record of the configuration file, find the available packages you want on the server, then download and install ,

Input terminal command line:

$ sudo apt-get install openssh-server

An error occurred:

Done Building dependency tree Reading state information packages ...
complete now not available packages openssh-server,
but other packages he was quoted this may mean that the package is missing may have been abandoned or only available from another source
E: package openssh-server not available for installation candidate

 

Screenshot:

 

Analyze the reasons may be because the source list apt-get inside the openssh can not find what I want to update with the Ubuntu system. Who maintains the source server back to you two years ago, even if there is, has experienced two years of marshes, corresponding updated address should be changed. The rescue method above problem is to update your sources.list, located in /etc/apt/sources.list. In addition, with the updated version, the old version of the source list in execution

This paper introduces a simple method of updating the source, as follows:

1.  Open the Settings "" software and updates

 

2.  Download the self -> drop-down box

Click on the "Select Best Server", the system will automatically test the optimal server source.

 

3.  Update System

Terminal command line:

sudo apt-get update

sudo apt-get upgrade

sudo apt-get dist-upgrade

After the update is successful:

 

Then re-execute the command top try:

$ sudo apt-get install openssh-server

系统会自动检索关联包,然后提示下载确认,输入:y  ,回车,等他自行下载安装。

不出意外的话,更新完后就已经安装好了,

启动SSH服务器:

$ sudo /etc/init.d/ssh start

或者 :$ sudo /etc/init.d/ssh resart

查看SSH服务器是否安装成功:

输入命令:ps -e|grep ssh

 

出现如图上的sshd就是我们安装的SSH服务器

也可以通过:ssh localhost命令看下。这个命令主要用来连接本机,如果出现需要密码,说明成功

 

用ifconfig命令查看Linux主机IP地址,在Windows中使用cmd命令行,输入ping命令测试。如果收到回码,通信正常。ping 192.168.91.129 

再使用Putty进行测试

Guess you like

Origin www.cnblogs.com/cyyz-le/p/11780246.html