How To Enable Root Login In SSH Config On Linux 7

We do disable root login on the server from the ssh config file because of security reasons. So if you want to enable root login in ssh config., you must follow the below settings and you can allow users to ssh to root login.

How To Enable Root Login In SSH Config :

you can use the ssh key to log in the server then switch to root user. we don’t give the root user access to anyone but we can give server access using ssh key to log in. 

Check Out: SSH Password less login Using SSH Keygen In Linux

By default, ssh installed on the machine. you can also change the ssh port number default 22 to another port number. All the server-side configuration needs to be changed in the sshd_config.

Step 1: Enable login in ssh config file

PermitRootLogin yes

Check Out: How To Install Rancher Container Orchestration Server In Linux

Step 2: Now enable password authentication for users.

PasswordAuthentication yes

Step 3: if u are still not able to login using root user, So add these lines in the sshd_config file.

AllowUsers root

Check Out: SSH Password less login Using SSH Keygen In Linux

Step 4: Restart the ssh service to take the effects.

systemctl restart sshd

You’re done. ssh allow root login allow user to ssh

Share on:

I'm the founder of Curious Viral. I hope this blog will provide you complete information about Linux Technology & I would like to share my technical knowledge with you which I have learned during this period.

Other Posts You May Like...

Leave a comment