Enabling/Disabling shell from command line

tinman

Registered
Mar 31, 2005
4
0
151
I need to allow a user ssh access but only between certain times over the course of an event.

What is the command line to enable and then disable shell access for that user?

Probably give the machine an at job rather than cron to give access as the command will only run a few times. If it goes in cron i'll forget about it.
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
79
458
cPanel Access Level
Root Administrator
The chsh -s command will change shells for an account. For example:

Code:
chsh -s /bin/bash user
You might also want to do research on PAM as I'm certain there exists a PAM module that will do what you want (i.e. only allow logins at specified times).