The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Enabling/Disabling shell from command line

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

  1. tinman

    tinman Registered

    Joined:
    Mar 31, 2005
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    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

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    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).
     
Loading...

Share This Page