/etc/passwd And The Hole In My Head...
What do you edit to set the default login shell for a user? This one took me all day. That's right- no mental giant here. I'll not post the bunny trails I went down to get this simple answer; I'll just give you the goods.
/etc/passwd
This file contains entries that look like this:
networker:x:1011:1009::/export/home/networker:/usr/bin/sh tester:x:1012:10::/home/tester:/usr/bin/bash saylesb:x:1005:1000::/home/saylesb:/bin/sh asmadm:x:1002:0::/usr/home/asmadm:/bin/csh
By editing the last entry, you change the default login shell. Voila!
Here are the /etc/passwd fields explained:
/etc/passwd
This file contains entries that look like this:
networker:x:1011:1009::/export/home/networker:/usr/bin/sh tester:x:1012:10::/home/tester:/usr/bin/bash saylesb:x:1005:1000::/home/saylesb:/bin/sh asmadm:x:1002:0::/usr/home/asmadm:/bin/csh
By editing the last entry, you change the default login shell. Voila!
Here are the /etc/passwd fields explained:
| Name | Specifies the user's login name. The user name must be a unique string of 8 bytes or less. There are a number of restrictions on naming users. See the mkuser command for more information. |
| Password | Contains an * (asterisk) indicating an invalid password or an ! (exclamation point) indicating that the password is in the /etc/security/passwd file. Under normal conditions, the field contains an !. If the field has an * and a password is required for user authentication, the user cannot log in. |
| UserID | Specifies the user's unique numeric ID. This ID is used for discretionary access control. The value is a unique decimal integer. |
| PrincipleGroup | Specifies the user's principal group ID. This must be the numeric ID of a group in the user database or a group defined by a network information service. The value is a unique decimal integer. |
| Gecos | Specifies general information about the user that is not needed by the system, such as an office or phone number. The value is a character string. The Gecos field cannot contain a colon. |
| HomeDirectory | Specifies the full path name of the user's home directory. If the user does not have a defined home directory, the home directory of the guest user is used. The value is a character string. |
| Shell | Specifies the initial program or shell that is executed after a user invokes the login command or su command. If a user does not have a defined shell, /usr/bin/sh, the system shell, is used. The value is a character string that may contain arguments to pass to the initial program. |


0 Comments:
Post a Comment
<< Home