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