0x00 Foreword
After ubuntu new installation, the default is not supported ssh to log in. However, when we usually ssh login frequently used. Therefore, install ssh service it.
The following are installed through, if any objections, please correct me.
0x01 install ssh
As used herein, it is openssh series of tools
-
And updating the system tools rely performed
sudo apt-get update
; -
The installation command:
sudo apt-get install openssh-server openssh-client
wait for the installation to complete.
0x02 start ssh
-
First check ssh is running, execute the command
sudo ps -e |grep ssh
, if there is no display, is not running ssh services. On the contrary, the word appears sshd, ssh express service has been running. -
If ssh is not running, use the command
sudo service ssh start
to start.
#启动
/etc/init.d/ssh start
#停止
/etc/init.d/ssh stop
#重新启动
/etc/init.d/ssh restart
#利用service命令
#启动
sudo service ssh start
#停止
sudo service ssh stop
#重新启动
sudo service ssh restart
So far, ssh already installed and running, you can use the ssh client to connect, but now is not on the connection.
When you are prompted to log in sshSSh服务拒绝连接
, how broken, please read on.
0x03 modify the configuration file
Here is the modified ssh configuration file:
/etc/ssh/sshd_config
-
Open the configuration file using a name:
gedit /etc/ssh/sshd_config
; -
The configuration file
PermitRootLogin without-password
line commented out; -
Add a new line:
PermitRootLogin yes
; -
Save the configuration file, restart the ssh service.
End 0x04
Do the above operation, no other accident, you can successfully use ssh to log in to the host.