Enable Remote Access Linux

22,669

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:
22,669

Related videos on Youtube

John M.
Author by

John M.

Updated on September 18, 2022

Comments

  • John M.
    John M. almost 2 years

    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

    • jmreicha
      jmreicha about 11 years
      What distribution on Linux are you using?
  • davidgo
    davidgo about 11 years
    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 [email protected] [email protected] "
  • joshreesjones
    joshreesjones over 10 years
    Can anyone post a link to a page that explains/documents this more completely?