Enable Remote Access Linux
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.
Related videos on Youtube
John M.
Updated on September 18, 2022Comments
-
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 about 11 yearsWhat distribution on Linux are you using?
-
-
davidgo about 11 yearsTo 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 over 10 yearsCan anyone post a link to a page that explains/documents this more completely?