2

It doesn't seem to work for some reason if I do this in /etc/profile:

export SHELL="/bin/bash/"
Alex
  • 8,471
  • 26
  • 75
  • 99

3 Answers3

4

The chsh $USER command changes users' shell.

If you want to change them all at once, you can modify the /etc/passwd file.

You don't want a trailing slash when attempting to execute a binary file.

Warner
  • 23,756
  • 2
  • 59
  • 69
1

To set the default shell when you create a new user, it depends how you create new users. For useradd in Linux (Ubuntu, at least), edit /etc/default/useradd and change the SHELL variable.

Dan Andreatta
  • 5,454
  • 2
  • 24
  • 14
0

I'm not sure if it's universal across Linux distros, but in most Unix implementations the file /etc/shells lists the shells that users can choose from. So if you don't want the users to be able to use chsh to change to something else, make sure bash is the only shell listed there.

coneslayer
  • 164
  • 3
  • /etc/shells also has other uses; in many ftpd implementations, /etc/shells is consulted to see if the user has a 'valid' shell. (this allows you to set their shell to /bin/false, but add it to /etc/shells, so they can use ftp, but not get a shell.) – Joe H. Mar 26 '10 at 01:57