Install and Setup SSH Service on Ubuntu 12.04

1. When installing
Ubuntu, openssh-client is installed by default, so it will not be installed here. If your system is not installed, you can install it with apt-get.
install ssh-server
sudo apt-get install openssh-server
install ssh-client
sudo apt-get install openssh-client

2. Confirm whether sshserver is installed
ps -e | grep sshd
  450 ? 00:00:00 sshd

If you see sshd, it means that ssh-server has been started.
If only ssh-agent indicates that ssh-server has not started, you need to execute the command to start the ssh service:
/etc/init.d/ssh start;
Note: Only sshd is displayed in the installation of ubuntu-12.04-server-i386.iso :

3. Extended configuration
The default service port of SSH is 22. Users can define other ports themselves, such as 222. The configuration file to be modified is:
/etc/ssh/sshd_config
Change the Port parameter in it to 222
and then restart the SSH service:
sudo /etc/init.d/ssh restart

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327058377&siteId=291194637