Howto change the shell Automatically each time i login???
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Howto change the shell Automatically each time i login???
which file would I edit(and what changes are to be made)to change my shell from bash to csh automatically everytime I login ,also give the line after the neccesary changes are made.
The file is "/etc/passwd" but you should NOT "edit" it. You should use the usermod command:
usermod -s /bin/csh <your login ID>
You have to have root to do that. Note that this changes your shell to csh so that is what you get a login rather than bash.
If you truly want to change from bash to csh AFTER login you can add:
"/bin/csh" to the end of your $HOME/.bashrc.
This would make csh a subshell of your bash (do "ps" after typing "/bin/csh" to see what I mean).
You could prevent it from being a subshell by putting:
"exec /bin/csh" at the end of your .bashrc. This makes it replace the shell rather than doing a fork to a subshell.
Note that csh uses different startup files than bash and ksh so make sure you add whatever you need to the appropriate files.
automatically everytime I login.. ,
this is in theory, i dont really want to do it. how would i do it via /etc/passwd ????.
just change /bin/bash to /bin/csh ?
its for a linux essentials correspndence course.
You can also use the chsh command. It will also edit /etc/passwd.
See the manpages for : shells chsh
I don't know what you mean by automatically. You change the shell, and it is changed until you change it back. If you log out and log in again, you start with the new shell.
The usermod command I mentioned modifies /etc/passwd.
My point was you should NOT modify the passwd file by hand if you can avoid it - it makes it easy to corrupt it and depending on how strong your authentication is might actually stop things from working on the assumption it is a hack attempt.
As noted by others you can use the chsh command to do the same thing.
It sounds however from your response that you want to do what I said about just running the /bin/csh (or exec /bin/csh) from command line.
You really shouldn't do your homework here - you learn more by figuring it out than by having people tell you what to do.
ye I know, I dont however have much time to do this anymore due to unforseen circumstances.
otherwise I wouldve figured it out on my own. anyways thanks for the help.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.