Skip to Content
Linux Administration Cookbook
book

Linux Administration Cookbook

by Adam K. Dean
December 2018
Beginner
826 pages
22h 54m
English
Packt Publishing
Content preview from Linux Administration Cookbook

AllowUsers

We've already denied the root user access to our system, but what if we wanted to take this a step further and specify the users we want to grant access to?

For that, we need the AllowUsers setting.

This is rarely a default setting, or even commented out in the sshd_config file, so we're going to add it to the bottom:

#       PermitTTY no#       ForceCommand cvs serverAllowUsers vagrant

Restart the SSH daemon:

[vagrant@centos2 ~]$ sudo systemctl restart sshd

Now, you've got a system that only the vagrant user will be able to SSH to. You can also add multiple names to this list, or even substitute this whitelist for a blacklist, with DenyUsers.

If we want, we can work on a group basis (instead of individual usernames) with AllowGroups and ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical Linux Security Cookbook - Second Edition

Practical Linux Security Cookbook - Second Edition

Tajinder Kalsi
Mastering Linux Administration

Mastering Linux Administration

Alexandru Calcatinge, Julian Balog

Publisher Resources

ISBN: 9781789342529Supplemental Content