How to set Access/Restrictions on users logins

I wanted to enable time limit for some users so they are able to use FTP server only during working time.

For RH based systems with Vsftpd

Open /etc/security/time.conf and add


to the end.

Then open /etc/pam.d/vsftpd and add

account    required

as the first line in account section so the file looks a like:

session    optional    force revoke
auth       required item=user sense=deny file=/etc/vsftpd/ftpusers onerr=succeed
auth       required
auth       include      password-auth
account    required
account    include      password-auth
session    required
session    include      password-auth

Save the changes and try to login via ftp. In case you want to disable SSH, you should do the same:


account    required

inside /etc/pam.d/sshd and


inside /etc/security/time.conf file.

Leave a Reply

Your email address will not be published. Required fields are marked *