How to change Bash to csh with username and password

6,076

The reason this command is failing is because you are providing too many parameters. chsh does not accept a password on the command line, and if you are trying to change someone else's account you must be root:

sudo chsh -s /bin/csh insite

If you don't have sudo, become root by whatever means is appropriate to your situation and run

chsh -s /bin/csh insite

If you are trying to change your own shell you don't even need to be root - provided /bin/csh is listed in /etc/shells. You will have to enter your own password, though, to prove it is you who wants to change your shell.

chsh -s /bin/csh
Password: _
Share:
6,076

Related videos on Youtube

avinash
Author by

avinash

Updated on September 18, 2022

Comments

  • avinash
    avinash over 1 year

    I want to change bash to csh I'm using following command which is not working chsh -s /bin/csh insite(user) insite(password).

    I need to write shell script with this command
    this is the output i got

    chsh -s /bin/csh insite insite 
    Usage: chsh [ -s shell ] [ --list-shells ] [ --help ] [ --version ] [ username ]
    
    • roaima
      roaima over 6 years
      What error message did you get? Why do you think that chsh takes a username and password as parameters?
    • avinash
      avinash over 6 years
      [insite@T37 ~]$ chsh -s /bin/csh insite insite Usage: chsh [ -s shell ] [ --list-shells ] [ --help ] [ --version ] [ username ]
    • avinash
      avinash over 6 years
      Chsh command is taking Username(insite). after executing this command asking password. if i enter password manual its working. now i want to write this command in script. how can i enter password in script?
    • thrig
      thrig over 6 years
      you'll likely need to use something like expect which can feed a password to chsh
    • Praveen Kumar BS
      Praveen Kumar BS over 6 years
      @ avinash Kindly clarify whether you want to reset the password or you want to switch as insite at that time its asking password
    • Арсений Черенков
      Арсений Черенков over 6 years
      is /bin/csh allowed ? does it appear in chsh --list-shell ?
    • Арсений Черенков
      Арсений Черенков over 6 years
      by the way chsh would be enough to change your own shell.