SSH localhost by command
To see if the SSH service is already installed
The SSH service is already installed, as shown in the following illustration
If a situation like the following appears, the SSH service is not installed on this machine
SSH localhost
Ssh:connect to host localhost Port 22:connection refused
First, let's talk about how to uninstall the SSH service. 1. Completely uninstall SSH service
Apt-get Purge Openssh-server
2, update the source list (you can install the latest SSH service)
sudo apt-get update
3. Install SSH Service
sudo apt-get install Openssh-server
Enter the following command system to automatically install the SSH service.
4, the first step after installing SSH service is to open SSH service sudo/etc/init.d/ssh start
Sudo/etc/init.d/ssh start
5, after the start, you can use the following command to see if the service starts correctly
Ps-e|grep SSH
6212? 00:00:00 sshd
6, after the completion of the boot can modify the SSH configuration
Gedit/etc/ssh/sshd_config
7, Next is part of the error and resolution
PS1: The first time the connection needs to enter the password, then no longer need to enter the password. Less to enter the SSH account password, is not more secure.
PS2: again restrict IP access SSH, the server will be more secure.
Vi/etc/hosts.allow
Sshd:172.16.x.x:allow #在最后一行写入172.16.x.x/172.16.0 (paragraph)
Vi/etc/hosts.deny
Sshd:all
PS3: Suppose you want to delete the public key, do not select the public key when connecting SECURECRT, and then enter the SSH configuration file to modify the following:
1. Annotation #authorizedkeysfile%h/.ssh/authorized_keys
2, Passwordauthentication Yes
PS4: Prompt when using SECURECRT connection: Unable to authenticate using any of the configured authentication methods
Resolved: Passwordauthentication Yes
Please correct me if there is a mistake.