LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Restrict user login (https://www.linuxquestions.org/questions/linux-newbie-8/restrict-user-login-882797/)

ust 05-26-2011 05:47 AM

Restrict user login
 
I use Rh server , can advise if I want to restrict the root user can not directly login to the system ( eg. ssh -l root IP_address" , what can i do ?

Thanks.

acid_kewpie 05-26-2011 05:49 AM

set PermitRootLogin to no in /etc/ssh/sshd_config and restart ssh.

ust 05-26-2011 11:08 AM

Thanks reply ,

if I want to restrict user login through all kinds of method ( eg. ssh , telnet , rsh ) not just by ssh , can advise what can i do ? thx

acid_kewpie 05-26-2011 11:23 AM

ahh then you want to actually do the job properly!! the permitrootlogin option is the usual favourite, but i recommend using /etc/security/access.conf instead to control things as a generic layer through pam, as this can match against any pam service name (amongst other things)

chrism01 05-27-2011 01:39 AM

Can I also add that using a non-encrypted form of cxn like telnet or rsh is a really bad idea, not just for the root user.
However, good advice from acid_kewpie if you really have to use them.

acid_kewpie 05-27-2011 01:46 AM

Quote:

Originally Posted by chrism01 (Post 4368304)
Can I also add that using a non-encrypted form of cxn like telnet or rsh is a really bad idea, not just for the root user.
However, good advice from acid_kewpie if you really have to use them.

Well my perspective would be that using access.conf provides an additional safety net *in case* these services are somehow running, going from something like a default permit for multiple services, to a default deny. Similar to have a default drop policy in iptables even when you're happy to permit access to every port that you know is already open, and that there is nothing else listening. You'd still expect connections on port 23 to not be allowed anywhere near userland.


All times are GMT -5. The time now is 11:35 PM.