{"id":2155,"date":"2013-07-07T11:30:51","date_gmt":"2013-07-07T03:30:51","guid":{"rendered":"http:\/\/rmohan.com\/?p=2155"},"modified":"2013-07-07T11:30:51","modified_gmt":"2013-07-07T03:30:51","slug":"disable-users-to-login-into-the-server","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=2155","title":{"rendered":"Disable Users to login into the server"},"content":{"rendered":"<p>Suppose we want to take a backup of user\u2019s account. So for that first of all we have to block the user to login into their account to maintain data integrity of user\u2019s backup files. So using below technique we can do that very easily.enjoy !!!<\/p>\n<p>Edit the pam file located in \/etc\/pam.d\/ directory for the service you want to control.<\/p>\n<p><strong>Example : <\/strong>Suppose you want to do control \u00a0ssh service<\/p>\n<p><strong>Step 1: Add below line in \/etc\/pam.d\/sshd file if it is not available.<\/strong><\/p>\n<p>account required pam_nologin.so<strong><\/strong><\/p>\n<p><strong>Step 2: Create the\u00a0\/etc\/nologin\u00a0file, <\/strong><\/p>\n<p># touch \/etc\/nologin<\/p>\n<p>This should disable the login from ssh for every user except administrator user(root).<\/p>\n<p><strong>Step 3: To re-enable the login just remove\u00a0\/etc\/nologin<\/strong><\/p>\n<p># rm \u2013rf \/etc\/nologin<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Suppose we want to take a backup of user\u2019s account. So for that first of all we have to block the user to login into their account to maintain data integrity of user\u2019s backup files. So using below technique we can do that very easily.enjoy !!!<\/p>\n<p>Edit the pam file located in \/etc\/pam.d\/ directory for [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/2155"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2155"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/2155\/revisions"}],"predecessor-version":[{"id":2156,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/2155\/revisions\/2156"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2155"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2155"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}