0

enter image description here

I'm interested in setting up some basic security on an ubuntu 16.4 vps that I'm working on. I'm reading through https://www.codelitt.com/blog/my-first-10-minutes-on-a-server-primer-for-securing-ubuntu/ and http://plusbryan.com/my-first-5-minutes-on-a-server-or-essential-security-for-linux-servers.

One of the recommendations is to use the ssh AllowUsers directive. Based on http://manpages.ubuntu.com/manpages/precise/en/man5/sshd_config.5.html ( and in the screenshot ) . If I'm understanding correctly, I can limit login by user name but not ip address by adding:

AllowUsers usename1 username2 ...

Is this correct?

1 Answer 1

1

If you read the excerpt you provided, you'll notice that AllowUsers directive can accept pattern USER@DOMAIN, so you can restrict access for a user from a single IP by specifying '[email protected]' or you can restrict to a subnet by using a pattern with a wildcard '[email protected].*'

3
  • Sorry If I didn't explain myself properly. I want to restrict by username but NOT ip address , because I may be connecting from different ip addresses. Commented May 22, 2017 at 15:15
  • Yes, you can limit access by just a username without restricting IP.
    – AlexD
    Commented May 22, 2017 at 15:17
  • 1
    like "AllowUsers usename1 username2" ? Commented May 23, 2017 at 13:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .