Monday, February 18, 2019

Oracle Linux -- Change Default Shell for a User

Problem

You want to change the default shell for a user on Oracle Linux or Red Hat Enterprise Linux

Solution

To find out what is the current shell in use for the current user use:

# echo $SHELL

To find available shell in the system use:

# cat /etc/shells

or

# chsh --list-shells

To change default shell for a user use:

# chsh -s <shell> [<username>]

where <shell> is the path to a shell found from the above steps, <username> - a user to change default shell for

For example:

$ chsh -s /bin/bash oracle
Changing shell for oracle.
Password:
Shell changed.

No comments: