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: _
Related videos on Youtube
Author by
avinash
Updated on September 18, 2022Comments
-
avinash over 1 year
I want to change bash to
csh
I'm using following command which is not workingchsh -s /bin/csh insite(user) insite(password)
.I need to write shell script with this command
this is the output i gotchsh -s /bin/csh insite insite Usage: chsh [ -s shell ] [ --list-shells ] [ --help ] [ --version ] [ username ]
-
roaima over 6 yearsWhat error message did you get? Why do you think that
chsh
takes a username and password as parameters? -
avinash over 6 years[insite@T37 ~]$ chsh -s /bin/csh insite insite Usage: chsh [ -s shell ] [ --list-shells ] [ --help ] [ --version ] [ username ]
-
avinash over 6 yearsChsh 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 over 6 yearsyou'll likely need to use something like
expect
which can feed a password tochsh
-
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 yearsis /bin/csh allowed ? does it appear in
chsh --list-shell
? -
Арсений Черенков over 6 yearsby the way chsh would be enough to change your own shell.
-