APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

2003/12/27 chsh

© December 2003 Tony Lawrence

Change your login shell. What shell you like is a matter of personal preference. I can argue that if you have no preference, you should be using bash (or ksh if bash isn't available), but if you have a lifetime of experience with csh or tcsh syntax, that's what you are going to want, and chsh will do it.

Generally speaking, DON'T CHANGE root's shell. I use to see this fairly often: some SunOS person would be hired to do some work on a SCO machine. Because SunOS historically used csh, using sh was of course very painful for them, so they'd change root's shell to csh. No problem, at least until the machine rebooted. Then all hell broke loose, because the csh didn't undertand how to run the /bin/sh initialization scripts.

Nowadays, the scripts would probably begin with #!/bin/sh and that would have been less painful, but it's still a better idea to leave things as the designers expected. Nothing stops you from just typing "bash" or "csh" after you login, and that's a far safer way of conducting your business.

Chsh is also used by admins to lockout users:

chsh -s /bin/true edward

locks edward out of the system for now without changing anything else about his account. If you really need to worry about Ed, you'd also move his home directory: "mv /home/edward /home/edward.locked" (which prevents him from possibly doing things with ssh that don't involve an actual shell, like forwarding ports).

Got something to add? Send me email.

(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> chsh

Inexpensive and informative Apple related e-books:

Digital Sharing Crash Course

Take Control of IOS 11

Photos: A Take Control Crash Course

Take Control of OS X Server

Take Control of Upgrading to El Capitan

More Articles by © Tony Lawrence

Printer Friendly Version

Have you tried Searching this site?

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us

Printer Friendly Version

One day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" (Larry Wall)

Linux posts

Troubleshooting posts

This post tagged:




Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode

SCO Unix Sales, Support, & Service

Phone:  707-SCO-UNIX (707-726-8649Toll Free: 833-SCO-UNIX (833-726-8649)