25

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?

Pablo Bianchi
  • 17,371
JohnMerlino
  • 7,829

4 Answers4

38

Answer from the Stack Overflow (switching from zsh to bash):

You can just use exec to replace your current shell with a new shell:

Switch to bash:

exec bash

Switch to zsh:

exec zsh

This won't affect new terminal windows or anything, but it's convenient.

Swap
  • 509
12

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

waltinator
  • 37,856
9

Open your terminal and use the following command:

chsh -s $(which bash)
Radu Rădeanu
  • 174,089
  • 51
  • 332
  • 407
Raja G
  • 105,327
  • 107
  • 262
  • 331
2

On Mac OS Catalina

  1. Change to zsh:

    chsh -s /bin/zsh
    
  2. Change to bash:

    chsh -s /bin/bash
    
Mono
  • 21