[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Commands Reference, Volume 1

chsh Command

Purpose

Changes a user's login shell.

Syntax

chshName [ Shell ] ]

Description

The chsh command changes a user's login shell attribute. The shell attribute defines the initial program that runs after a user logs in to the system. This attribute is specified in the /etc/passwd file. By default, the chsh command changes the login shell for the user who gives the command.

The chsh command is interactive. When you run the chsh command, the system displays a list of the available shells and the current value of the shell attribute. Then, the system prompts you to change the shell. You must enter the full path name of an available shell.

If you have execute permission for the chuser command, you can change the login shell for another user. To change the login shell for another user, specify a Name parameter. Valid shells are defined in the usw stanza of the /etc/security/login.cfg file. The default list of valid shells is: /usr/bin/ksh, /usr/bin/sh, /usr/bin/bsh, /usr/bin/csh but your system manager may have defined more.

Security

Access Control: All users should have execute (x) access to this command since the program enforces its own access policy. This command should be installed as a program in the trusted computing base (TCB). The command should be owned by the security group with the setgid (SGID) bit set.

Files Accessed:

Mode File
x /usr/bin/chuser
r /etc/security/login.cfg
rw /etc/passwd

Examples

  1. To change the shell that runs after you log in to the system, enter:
    chsh
    Information similar to the following appears:
    current available shells:
     /usr/bin/sh
     /usr/bin/bsh
     /usr/bin/csh
     /usr/bin/ksh:
    current login shell:
     /usr/bin/ksh
    change (y/n)? >
    Indicate that a change should be made by entering y after the change (y/n)? prompt. Then, add the name of the shell you want when the to? prompt appears, as in the following example:
    change (y/n)? > y
    to? > /usr/bin/csh
    The next time you log in, the /usr/bin/csh shell appears.
  2. To change the shell to /usr/bin/ksh for kim, enter:
    chsh kim /usr/bin/ksh

Files

/usr/bin/chsh Specifies the path to the chsh command.
/usr/bin/chuser Changes user information.
/etc/passwd Contains the basic user attributes.
/etc/security/login.cfg Contains login configuration information.

Related Information

The chgroup command, chgrpmem command, chuser command, lsgroup command, lsuser command, mkgroup command, mkuser command, passwd command, pwdadm command, rmgroup command, rmuser command, setgroups command, setsenv command.

Security Administration in AIX Version 4.3 System Management Concepts: Operating System and Devices describes the identification and authentication of users, discretionary access control, the trusted computing base, and auditing.


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]