Ubuntu does not have SSH service installed by default, and if you connect to Ubuntu remotely via SSH, you will need to manually install Ssh-server.
To determine whether or not to install the SSH service, you can do so by using the following command:
The output is as follows:
zht@zht-ubuntu:~$ ps-e|grep ssh
2151? 00:00:00 ssh-agent
5313? 00:00:00 sshd
Ssh-agent said Ssh-client started, Sshd said Ssh-server started.
If sshd is missing, the SSH service is not started or is not installed.
To install the ssh-client command:
sudo apt-get install openssh-client
To install the Ssh-server command:
sudo apt-get install Openssh-server
After the installation is complete, start the service first:
Sudo/etc/init.d/ssh start
After startup, you can view the correct startup through Ps-e|grep ssh.
SSH Service The default port is 22, you can change the port, and use the following command to open the SSH configuration file:
sudo gedit/etc/ssh/sshd_config
The contents of the configuration file are as follows:
# Package generated configuration file
# the SSHD (8) manpage
for details # What ports, IPs and protocols we Sten for
Port
# Package generated configuration file # and the
sshd (8) manpage for details
# What Ports , IPs and protocols we listen for
After modifying the port number (port), restarting the SSH service will take effect with the following commands:
Sudo/etc/init.d/ssh restart
SSH service is launched, you can login, login command format: SSH account @ip Address
For example:
When prompted to enter the password for test, you can log on remotely.
Exit Remote login Command: Exit
The following illustration shows:
Original link: http://blog.csdn.net/zht666/article/details/9340633
The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.