Allow/Disallow Root SSH Login: Difference between revisions

From KlavoWiki
Jump to navigationJump to search
No edit summary
No edit summary
 
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>
PermitRootLogin Yes
PermitRootLogin Yes
</pre>
== Disallow ==
To disallow root login remove the above line or change it to
<pre>
PermitRootLogin No
</pre>
</pre>


Line 14: Line 22:
</pre>
</pre>


To disallow root login remove the above line or change it to
= Restart daemon =
<pre>
PermitRootLogin No
</pre>
 
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