Ubuntu open SSH login

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

  1. And updating the system tools rely performed sudo apt-get update;

  2. The installation command: sudo apt-get install openssh-server openssh-clientwait for the installation to complete.

0x02 start ssh

  1. 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.

  2. If ssh is not running, use the command sudo service ssh startto 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 ssh SSh服务拒绝连接, how broken, please read on.

0x03 modify the configuration file

Here is the modified ssh configuration file:/etc/ssh/sshd_config

  1. Open the configuration file using a name: gedit /etc/ssh/sshd_config;

  2. The configuration file PermitRootLogin without-passwordline commented out;

  3. Add a new line: PermitRootLogin yes;

  4. 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.

 

Published 23 original articles · won praise 2 · views 10000 +

Guess you like

Origin blog.csdn.net/wenson0705/article/details/104776241