SSH in Debian & Ubuntu: install SSH

Install SSH on Debian System
#apt-get -y update && apt-get -y install openssh-server && systemctl restart ssh
Edit sshd_config:
#nano /etc/ssh/sshd_config
Change #PermitRootLogin prohibit-password
to
PermitRootLogin yes
then save.
 
Restart ssh:
#systemctl restart ssh
 
 
Ubuntu SSH Install
 
1. Login to you CLI via your client area service - noVNC or Xterm.js Console
 
2. It is always good to run a update on your newly installed VPS.
 
You can do that by typing:
 
#apt-get -y update
 
After Ubuntu is updated it is time to install SSH server by typing:
 
#apt-get  -y install openssh-server && systemctl restart ssh
 
When the install have finished you have to change 2 rows in sshd_config, you do that with a text editor called nano.
 
Type:
 
#nano /etc/ssh/sshd_config
 
 
 
Scroll down your cursor to the row: "#PermitRootLogin without-password" 
 
Delete the # and change to: PermitRootLogin yes
 
Or it if it look like this: PermitRootLogin prohibit-password
Change it to: PermitRootLogin yes
 
 
 
 
It should look something like this:
 
 
 
# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.
 
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
 
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options override the
# default value.
 
#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
 
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_*****_key
 
# Ciphers and keying
#RekeyLimit default none
 
# Logging
#SyslogFacility AUTH
#LogLevel INFO
 
# Authentication:
 
#LoginGraceTime 2m
PermitRootLogin yes



# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication yes
 
 
On your keyboard press CTRL + x
and when asked if you want to save press y and hit enter
 
 
No you can restart ssh-server by typing:
 
#systemctl restart ssh
 
Or
 
#service ssh restart
 
You can check to see if ssh-server is running by typing:
 
#systemctl status ssh
 
 
 
After this you should now be able to access you VPS from any console with:
 
#ssh root@youripnumber

 

  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

How to connect to VPS with SSH Using Windows, Linux or macOS

Connecting with SSH (Secure Shell)There are 2 primary ways to connect to a Linux VPS. The first...

SSH in CentOS 6: install - start & stop - enable & disable SSH server

  To accept SSH connections, the system must first be running the SSH server.CentOS 6 installs...

SSH in CentOS 7: install - start & stop - enable & disable SSH server

OpenSSH Server is available under default yum repositories. We can install or update the latest...