Changing Default Shell in Linux

Changing default shell in Linux

Try linux command chsh.

The detailed command is chsh -s /bin/bash.
It will prompt you to enter your password.
Your default login shell is /bin/bash now. You must log out and log back in to see this change.

The following is quoted from man page:

The chsh command changes the user login shell. This determines the
name
of the users initial login command. A normal user may only change the
login shell for her own account, the superuser may change the login
shell for any account

This command will change the default login shell permanently.

Note: If your user account is remote such as on Kerberos authentication (e.g. Enterprise RHEL) then you will not be able to use chsh.

Changing default shell to our own written shell in linux

The login shell of a user account is defined inside the unfamous /etc/passwd file. Just use a plain text editor and change it (e.g. joe /etc/passwd):

This is a typical example entry:

john:x:1000:100:John Doe:/home/john:/bin/bash

At the end you can see the absolute path of the executable configured as the accounts login shell. Just change it point to your custom shell.

Note that this changes the login shell. So to see the effect you have to relogin, not just to open a new terminal. So either test it by connecting to localhost using ssh for example or logout/login to your graphical desktop.

Changing default shell in Linux Mint

I found the answer on AskUbuntu:

Cinnamon uses gnome-terminal and one must edit their profile to run any other shell than the default (bash).

How can I change default shell without opening terminal?

  • In the Terminal app on your Mac, choose Terminal > Preferences, then click General.
  • Under “Shells open with”, select “Command (complete path)”, then enter the path to the shell you want to use.

You can also change this from System Preferences. Head to System Preferences > Users & Groups on your Mac. Click the lock icon and enter your password. Hold the Ctrl key, click your user account’s name in the left pane, and select “Advanced Options.”



Related Topics



Leave a reply



Submit