{"id":591,"date":"2018-10-17T19:39:42","date_gmt":"2018-10-17T19:39:42","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw92\/?p=591"},"modified":"2018-10-18T14:27:21","modified_gmt":"2018-10-18T14:27:21","slug":"how-to-disable-root-ssh-login-on-linux","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/10\/17\/how-to-disable-root-ssh-login-on-linux\/","title":{"rendered":"How to  Disable Root SSH Login on Linux ?"},"content":{"rendered":"<p>One of the biggest security holes you could open on your server is to allow directly<\/p>\n<p>logging in as root through ssh, because any cracker can attempt to brute force<\/p>\n<p>your root password and potentially get access to your system if they can figure out your password.<\/p>\n<p>It\u2019s much better to have a separate account that you regularly use and simply<\/p>\n<p>sudo to root when necessary. Before we begin, you should make sure that<\/p>\n<p>you have a regular user account and that you can su or sudo to root from it.<\/p>\n<p>To fix this problem, we\u2019ll need to edit the sshd_config file, which is the main configuration<\/p>\n<p>file for the sshd service. The location will sometimes be different, but it\u2019s usually in \/etc\/ssh\/.<\/p>\n<p>Open the file up while logged on as root.<\/p>\n<p>$ vi \/etc\/ssh\/sshd_config<\/p>\n<p>Find this section in the file, containing the line with \u201cPermitRootLogin\u201d in it.<\/p>\n<p>#LoginGraceTime 5m<br \/>\n#PermitRootLogin no<br \/>\n#StrictModes yes<br \/>\n#MaxAuthTries 6<\/p>\n<p>Make the line look like this to disable logging in through ssh as root. Uncomment that line<\/p>\n<p>PermitRootLogin no<\/p>\n<p>Now you\u2019ll need to restart the sshd service:<\/p>\n<p>\/etc\/init.d\/sshd restart<\/p>\n<p>Now nobody can brute force your root login, at least.<\/p>\n<p><a href=\"https:\/\/www.linuxforfreshers.com\/2018\/06\/how-to-disable-root-ssh-login-on-linux.html\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the biggest security holes you could open on your server is to allow directly logging in as root through ssh, because any cracker can attempt to brute force your root password and potentially get access to your system if they can figure out your password. It\u2019s much better to have a separate account &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/10\/17\/how-to-disable-root-ssh-login-on-linux\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to  Disable Root SSH Login on Linux ?&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-591","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/591","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=591"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/591\/revisions"}],"predecessor-version":[{"id":716,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/591\/revisions\/716"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=591"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=591"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=591"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}