Step-by-step how to change login shell using Linux chsh command.
Step by step example to change login shell using Linux chsh command.
Using Linux chsh command on the bash shell command prompt to change login shell on Linux fedora core with example. The article below show the step by step procedure to change shell for user on Linux Fedora Core operating system.
Linux command name: chsh
Command Description:
The Linux 'chsh' command is the command that usually used to change login shell on Linux operating system.
Command type:
'file' disk file (external command)
The example below demonstrate the use of Linux 'chsh' command to change the shell or login shell for user on the Linux system, all the example is execute on the Fedora Core Linux machine, the executed example may vary on for other Linux flavor.
What shell am I using?
Below is the example on how to get information on the type of shell that you are using on the system. The output of command below display your current shell. Make sure you used this command to verify your shell changes.
[root@fedora ~]# echo $SHELL
/bin/bash
Get help for the cshs command.
The output of chsh command with the –help option below, prompt the usage of the chsh command.
[root@fedora ~]# chsh --help
Usage: chsh [ -s shell ] [ --list-shells ] [ --help ] [ --version ]
[ username ]
Check type of shell available in the system.
To list type of shell install and available on your Linux system. The example below show the execution of chsh commands to produce the same output that shows the number of different shell installed on the system.
[root@fedora ~]# chsh --list-shells
/bin/sh
/bin/bash
/sbin/nologin
/bin/ash
/bin/bsh
/bin/ksh
/usr/bin/ksh
/usr/bin/pdksh
/bin/tcsh
/bin/csh
/bin/zsh
or
[root@fedora ~]# chsh -l
/bin/sh
/bin/bash
/sbin/nologin
/bin/ash
/bin/bsh
/bin/ksh
/usr/bin/ksh
/usr/bin/pdksh
/bin/tcsh
/bin/csh
/bin/zsh
Step to change Linux login shell.
The example below show the use of chsh command to change shell for current user.
[kambing@fedora ~]$ chsh
Changing shell for kambing.
Password:
New shell [/bin/bash]: /bin/csh
Shell changed.
[kambing@fedora ~]$ chsh -s /bin/bash
Changing shell for kambing.
Password:
Shell changed.
The chsh command issue with no option and –s option with the full pathname of the desired shell, is used to change shell for the user and it will prompt user for their password (note: the password only prompt for non-root user). In above example we change the shell to /bin/csh (C SHell) and to /bin/bash (Bourne-Again Shell). NOTE: the changes will take effect after you logout and login again.
Step to change shell for other user.
[root@fedora ~]# chsh -s /bin/csh kambing
Changing shell for kambing.
Shell changed.
The example above show, the chsh command is issue by the root operator to change shell for another user in this case is for user kambing.
Need help or need more information use:
# info coreutils chsh
# man chsh
# chsh --help
Related:
Keywords: change shell, chsh, chsh command, using chsh, login shell, linux shell, change user shell, using linux chsh command, chsh command, changing shell, shell example, change bash shell, change login prompt, linux shell, change fedora core shell.
- Add new comment
- 22589 reads
- Email this page
Thanks for Reading and Check Other Popular Linux Topics
All time:
- Configure and Setup Squid Cache Proxy Server on Fedora Core.
- Using Linux rm command to delete, remove hidden files and folder - Basic Linux Command.
- Copy Linux Files and Copy Directory Using cp Command - Linux Basic Command.
- Moving or rename files and directory using Linux mv command - Basic Linux Command.
- Add, view, edit and configure route and static route on Linux Fedora Core - Linux Server Configuration.
- Get and display the size of file and directory in Linux system using du command.
- Step by step Install Setup and Configure Linux Fedora Core Server and Network Management with Screen Shot and Example.
- Create file and display file contents in Linux using cat command.
- Configure Squid to block HTTP request to specific web sites.
- Example of samba smbpasswd file and samba smbusers configuration file.

1 comment
My shell changed
Submitted by Ked Edgar (not verified) on Sun, 05/13/2012 - 13:09.Hullo,
I have a problem with my shell.
I was trying to change the shell using the chsh command in ISOLINUX.
An incorrect shell was entered but till now I can not become root using the sudo su command. It tells me incorrect shell.
What can I do...
Ked Edgar eked290@gmail.com