

If you created the file, then you are usually the owner of that file, and your group, or the group associated with the folder you created the file in, will usually be associated with that file. Every file (and folder) also has an “owner” and a “group” associated with it. On a UNIX web server, every single file and folder stored on the hard drive has a set of permissions associated with it, which says who is allowed to do what with the file. In this tutorial, I’m going to explain the concept of permissions, and show you how to set permissions using your FTP program or via SSH. You need to set the correct permissions on CGI scripts when you install them, to stop those dreaded “500 Server Error” messages. Great, that is all about how to allow/deny specific users to login via SSH on Ubuntu 18.04 system.One of the hardest things for the beginner webmaster to get to grips with is how to use chmod correctly to set permissions on files on UNIX and Linux web servers. Remember to reload SSH whenever you make any changes. To deny a group of users, say the administrator group whose members are admin and mibey, you would add the following line to SSHd configuration file. If you try to login as any of the above users, you will get permission denied. Similarly, to deny a specific user from logging in via SSH, you simply use the DenyUsers or DenyGroups option with a list of users or groups to deny access respectively. Deny Specific Users to Login via SSH on Ubuntu 18.04.If you try to login as a user who is not a member of the administrators group, you will get permission denied.

This will allow only the members of the administrators group login getent group administrators To allow a specific group of users to login, you would add the following line to SSHd configuration file AllowGroups administrators If you check authentication logs, it states clearly Mar 27 19:46:07 u18svr sshd: User mibey from 192.168.0.101 not allowed because not listed in AllowUsers Now, if you try to login as any other user apart from the two allowed above, you should get permission denied.
