Complete SSH service configuration and troubleshooting in Ubuntu

Source: Internet
Author: User
For Linux development in Windows and virtual machines, how can I avoid using SSH. Some people say, "For Linux development, we don't have to directly install machines and run them on them. We also need to mount virtual machines and enable SSH ...... It hurts. "In any case, I have been in touch with Linux for three years. I have used Ubuntu for three years. I understand Ubuntu, ubuntu has made remarkable achievements in many releases of Linux, but many aspects of Linux in PC systems are not very well-positioned. the user experience is good and the performance is also worth mentioning. I also love Linux development under Li Windows. How can I install a virtual machine without using SSH. Some people say, "For Linux development, we don't have to directly install machines and run them on them. We also need to mount virtual machines and enable SSH ...... It hurts. "In any case, I have been in touch with Linux for three years. I have used Ubuntu for three years. I understand Ubuntu, ubuntu has made remarkable achievements in many releases of Linux, but many aspects of Linux in PC systems are not very well-positioned. the user experience is good and the performance is also worth mentioning. I also love Linux, But I cannot deny its slight trend in this regard. Of course, its powerful command line, network service, and gorgeous interface are incomparable to windows. Therefore, most cross-compiling environments or normal development environments are completed in windows + Vmware (or VisualBox, many articles on installing SSH services on the Internet are not in place, and most of them have been transferred for many times. I think it is necessary to sort out the articles by myself to facilitate future use, by the way, it can also help others.

OK, start now .....

(Please read the full text before proceeding to the operation. I wrote articles and configured them. There were a lot of problems in the middle. After reading them, you can take a few detours ...)

The apt-get tool of Ubuntu is powerful, but it does not have a powerful network. It seems that it has become a weakness when it leaves the network. Therefore, open the terminal command line:

$ Sudo apt-get install openssh-server

I'm leaving. What's going on? How is my command like this? It's probably yours. See you.




What's going on? You guess ...... I guess the source list of apt-get cannot find the openssh I want, right. The Apt-get application searches for the available software packages on the server through a configuration file that records all available software packages, and then downloads and installs them. No wonder, it's 11.04 now. I ran Ubuntu 9.04. Whose server has maintained the source for you two years ago. Even if there is, after two years of experience, the corresponding update address should also change. To solve this problem, update your sources. list, which is located in/etc/apt/sources. list. You can search for the source list by yourself, that is, copy and paste the source list. Do not forget sudo. In addition, as the version is updated, the source list of the old version is executed:

$ Sudo apt-get update

There will be a large number of not found. Verify that the source list of this version has expired. Try to find the new version.

After the jun is successfully updated:




Run the preceding command again:

$ Sudo apt-get install openssh-server

The associated package is automatically retrieved, and a prompt is displayed for download confirmation. Enter y and press enter to download and install the package.

If there is no accident, it will be installed after the update. In fact, there are some other minor accidents. However, when ssh_config is automatically configured, the operation of the service is theoretically not affected. (In this case, I am installing and writing articles, and everything is real-time. Who knows if the installation is successful next ?), Haha, let's continue. Check out my error page:



 

Let's start the service:

$ Sudo/etc/init. d/ssh start

Or: $ sudo/etc/init. d/ssh resart

I don't want to be perfunctory here. I can't start it anymore. Restart the Virtual Machine and try again. I guess there are some updates, configurations, kernel locks not released, and the locks held during Linux kernel management and updates, which will affect the startup of some services, try again later. Restart:

$ Sudo halt now (enable it after it is disabled or restart. I always feel that it will be faster after halt is started)

$ Sudo reboot (amount, or reboot faster)

Sure enough, it cannot be restarted. Are you having the same problem? Maybe you have already run away, so I have to finish it. Or cannot start. What should I do? I have collected it for a long time. I said on the Internet that I had uninstalled the openssh client and re-installed it (ps: Ubuntu already contains the client by default, so I will try it again .)

$ Sudo apt-get remove openssh-client

Wait for a moment and simply unload the installed opensshserver. Everything starts from scratch.

$ Sudo apt-get remove openssh-server

Then install the client first:

$ Sudo apt-get install openssh-client

Still not good, fruitless, good people did not make it, they fell. Last installed, it was okay ...... The problem is the most advanced. I will continue.

Cause: it should be a version problem. The system is 9.04 and the update list of 10.04 is used. This causes compatibility issues. On the basis of the original, the system detects it by itself. After upgrade manager automatically updates some libraries, the service starts itself. Look at the sshd process:




It is also possible that the system automatically updates the system package according to the installation records of the original file, and the system installs the service by itself.

Let's log on and try. Here, SecureCRT is used to access Ubuntu in Windows 7, and there is no Super Terminal in Windows 7. SecureCRT is also very easy to use and can also be used as a serial port tool to see the running effect:


You can ping each other, and the service is normal, but the connection is still unavailable. Continue ...... I think reboot again.

Second, nothing changed. It is OK to create a connection in SecureCRT. Figure:


OK, here we are ...... Thank you for reading. Reprinted. Jun is available.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.