How to Enable SSH Password Authentication

Some server providers, such as Amazon EC2 and Google Compute Engine, disable SSH password authentication by default. That is, you can only log in over SSH using public key authentication.

SFTP is a protocol that runs over SSH, so this means SFTP using passwords will not work by default when SSH password authentication is disabled.

To enable SSH password authentication, you must SSH in as root to edit this file:

/etc/ssh/sshd_config

Then, change the line

PasswordAuthentication no

to

PasswordAuthentication yes

After making that change, restart the SSH service by running the following command as root:

sudo service ssh restart

Enable Logging In as root

Some providers also disable the ability to SSH in directly as root. In those cases, they created a different user for you that has sudo privileges (often named ubuntu). With that user, you can get a root shell by running the command:

sudo -i

If you instead want to be able to directly SSH in as root, again edit this file:

/etc/ssh/sshd_config

And change the line

PermitRootLogin no

to

PermitRootLogin yes

After making that change, restart the SSH service by running the following command as root:

sudo service ssh restart

If you enable this setting, don't forget to set a strong password for root by running the command.

sudo passwd root

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Configure CentOS 6 Network Settings

Overview This tutorial will walk you through configuring your network configurations on CentOS...

Changing the SSH port for Linux server (VPS & Dedicated server)

Changing the SSH Port for Your Linux Server You can change the default SSH port for your Linux...

cPanel/WHM Locations of Logs

CPANEL LOGS     cPanel Access Log     cPanel Apache Log     cPanel Backup Log...

How to enable or disable public key authentication in SSH

SSH server in most systems is by default configured to allow public-key authentication. The...

Install iRedMail Server on Ubuntu 20.04|18.04

This tutorial will show you how to install iRedMail Email Server on a Linux server running Ubuntu...