Linux-ubuntu configure ssh

1. installation
Ubuntu installs openssh-client by default, so it is not 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, then ssh-server has been started.
If only ssh-agent indicates that ssh-server has not been started, you need to execute the command to start the ssh service:
/etc/init.d/ssh start;
Note: Only sshd is displayed in the ubuntu-12.04-server-i386.iso installation:

3. Extended configuration
The default service port of SSH is 22, and users can customize it to other ports, such as 222. The configuration files that need to be modified are:

/etc/ssh/sshd_config
Modify the Port parameter inside to 222


If you encounter the problem that the root user cannot log in remotely

Just in /etc/ssh/sshd_config

Find PermitRootLogin no, change no to yes and restart


Then restart the SSH service:
sudo/etc/init.d/ssh restart

Or use

service ssh restart

Recommended Posts

Linux-ubuntu configure ssh
Configure centos container to support ssh in Docker