Allow/Disallow Root SSH Login: Difference between revisions

From KlavoWiki
Jump to navigationJump to search
Created page with "<pre> vi /etc/ssh/sshd_config </pre> To allow root login from SSH add the line <pre> PermitRootLogin Yes </pre> To disallow root login remove the above line or change it to..."
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
= Edit Config File =
<pre>
<pre>
vi /etc/ssh/sshd_config
vi /etc/ssh/sshd_config
</pre>
</pre>


== Allow ==
To allow root login from SSH add the line
To allow root login from SSH add the line
<pre>
<pre>
Line 8: Line 10:
</pre>
</pre>


== Disallow ==
To disallow root login remove the above line or change it to
To disallow root login remove the above line or change it to
<pre>
<pre>
Line 13: Line 16:
</pre>
</pre>


or
<pre>
PermitRootLogin without-password
</pre>
= Restart daemon =
Then restart the SSH daemon
Then restart the SSH daemon
<pre>
<pre>

Latest revision as of 05:46, 15 May 2016

Edit Config File

vi /etc/ssh/sshd_config

Allow

To allow root login from SSH add the line

PermitRootLogin Yes

Disallow

To disallow root login remove the above line or change it to

PermitRootLogin No

or

PermitRootLogin without-password

Restart daemon

Then restart the SSH daemon

systemctl restart ssh