Putty Connect Debian Linux error connection Refused__linux

Source: Internet
Author: User

The Ubuntu default does not have SSH service installed, and if you link Ubuntu via SSH, you will need to manually install Ssh-server. To determine whether to install the SSH service, you can do so by using the following command: xjj@xjj-desktop:~$ ssh localhost ssh:connect to host localhost Port 22:connection refused

As shown above, indicates that no installation has yet been made and can be installed via apt, commands as follows: xjj@xjj-desktop:~$ sudo apt-get install Openssh-server

The system will automatically install, after installation completes, starts the service first: xjj@xjj-desktop:~$ sudo/etc/init.d/ssh start

After startup, you can check to see if the service is starting correctly with the following command xjj@xjj-desktop:~$ ps-e|grep ssh 6212? 00:00:00 sshd
Start OK as indicated above. Note that the SSH default port is 22, you can change the port, stop after the change,
And then the start is OK. Change the configuration under/etc/ssh/sshd_config, as shown below. xjj@xjj-desktop:~$ Vi/etc/ssh/sshd_config # Package generated configuration file # the SSHD (8) manpage for< /c0> Details # What ports, IPs and protocols we listen for Port 22


Finally, it should be the time to connect. Please see the following command: xjj@xjj-desktop:~$ ssh exceljava@192.168.158.129

Just installed a Debian
Putty connects the Debian in the virtual machine, prompting that connection refused
sudo apt-get install Openssh-server

Then confirm that the Sshserver is started:

Ps-e |grep SSH

If only ssh-agent that Ssh-server has not started, need to/etc/init.d/ssh start
The Ssh-server configuration file is located in/Etc/ssh/sshd_config, where you can define the service port for SSH, with the default port of 22

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.