Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Enabling/Disabling shell from command line

Discussion in 'General Discussion' started by tinman, Apr 28, 2008.

  1. tinman

    tinman Registered

    Mar 31, 2005
    Likes Received:
    Trophy Points:
    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.
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Apr 7, 2006
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    The chsh -s command will change shells for an account. For example:

    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).
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice