1

I have read a couple questions on the forum that have related to the time.conf but as far as i can tell no one has been able to make it work.

I need to configure the time.conf to stop the user "test" from having ssh access from 10 am to 1 pm, aside from having this in the time.conf file it seems i also need to activate this but so far i have had no luck.

Currently i have this in my time.conf file: sshd;*;test;Al1000-1300

I have also added the line: account required pam_time.so to the files: /etc/pam.d/config-util ""/sshd ""/login

In the file /etc/ssh/sshd_config i have UsePAM yes

With all these settings i am still able to ssh into the server as test at any time of day.If anyone can tell me extra files i need to enable this in or if my entries are incorrect it would be greatly appreciated.

  • What can you see in the logs? – Jakuje Jul 12 '17 at 10:01
  • in the messages log when i ssh with the test user i get: Created slice user-1000.slice. Starting user-100.slice. started session 17 of user test. systemd-logind: New session 17 of user test. – a.smith Jul 12 '17 at 10:09
1

Stumbled along the answer, i needed to have ! before the time so the setting in time.conf is:

sshd;*;test;!Al1000-1300

Seems you only need line: account required pam_time.so in the file /etc/pam.d/sshd and it needs to be the first of the account enteries.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.