Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

My web server was tampered by someone who was using zsh shell. I feel more comfortable using bash shell, as that's the defaults that come with Ubuntu and OS X (the two main operating systems I use). But this questions is focused on Ubuntu server. I have 4 websites running on this web server, I use byobu, I use tmux, I use ruby/ruby on rails, node.js, apache, a few daemons. If I switch the current root shell from zsh to bash, could there be any negative side effects that might result from this switch? For example, will processes be killed because their parent process (the shell) has been switched?

share|improve this question
    
Are you asking about the consequences of the change (which are none, I'm using zsh right now and can switch to bash whenever I like) or are you asking about how to effectively change the shell? –  Braiam Dec 3 '13 at 23:59
    
@Braiam I am nervous about the consequences of the change. If there are no consequences, then I will change. I was just thinking that the shell was a parent process to some of these daemons like apache, and if I was to switch out of it, that it would kill the apache process. But I guess I am wrong. –  JohnMerlino Dec 4 '13 at 0:03

2 Answers 2

up vote 0 down vote accepted

Changing your shell, via sudo chsh --shell=/bin/bash $USER will change the shell field in /etc/passwd. This value is only consulted at login time, when the system has no idea of which shell to use for you.

Running processes, whether started by zsh, bash apache or evil_overlord's_program won't be affected

share|improve this answer
    
Isn't the shell the parent process of other processes running in it, or just the controlling terminal (and not the shell) would be considered the parent process? –  JohnMerlino Mar 13 at 19:50
    
The login program runs in a process, like everything. When it lets you in, it creates another process with your UID, etc, and runs /bin/bash (from /etc/passwd). The bash shell reads from STDIN (set up by login), and will fork/exec non-builtin commands, wait for them to terminate, and loop for more commands. The idea of "controlling terminal" is not useful in Unix/Linux. –  waltinator Mar 13 at 23:49

Open your terminal and use the following command:

chsh -s $(which bash)
share|improve this answer
    
I assume this is the equivalent of chsh -s /bin/bash –  JohnMerlino Mar 13 at 19:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.