Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

It might sound very basic question but I am beginner on Linux...

I have created a few users on my Linux distribution. I would like to enable Remote Connection through SSH for some of these users not all of them, of course.

The problem is that I don't know where to start , what files should I change their configuration ?

I suspect /etc/ssh/sshd_config , but I don't want to do something - well you know - "bad-ish" and destroy my system. My main purpose is to make this as secure as possible.

Regards

share|improve this question
    
What distribution on Linux are you using? –  jmreicha Mar 28 '13 at 19:53

1 Answer 1

up vote 2 down vote accepted

Yes, you are right about sshd_config file.

most probably you don't have a line starting with AllowUsers or DenyUsers but you can add a line with either of these keywords, followed by the usernames, separated by spaces. Depending on which path you choose to go, i.e., Allow or Deny paths, the behavior will be as the keyword describes. If you have few users to allow in via ssh use AllowUsers. Otherwise, use DenyUsers to disable a small set of users from being able to log in.

Exercise utmost respect to what you are doing. If you are on a production system and make a typo or forget to include an essential user name in the list, you may cause a lot of headache to yourself.

Needless to say, after editing sshd_config file, make sure you restart sshd service.

share|improve this answer
    
To clarify this response - simply edit /etc/ssh/sshd_config and add a line "AllowUsers username1 username2 username3" to the end to only allow username1, username2 and username3. You can further limit access by using the form "AllowUsers username1@ip.add.res.s username2@ip.add.res.s " –  davidgo Mar 28 '13 at 20:01
    
All right, thanks pals . –  John M. Mar 28 '13 at 22:11
    
Can anyone post a link to a page that explains/documents this more completely? –  mathguy54 Dec 30 '13 at 6:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.