Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

chsh(1) [v7 man page]

CHSH(1) 							   User Commands							   CHSH(1)

NAME
chsh - change login shell SYNOPSIS
chsh [options] [LOGIN] DESCRIPTION
The chsh command changes the user login shell. This determines the name of the user's 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. OPTIONS
The options which apply to the chsh command are: -h, --help Display help message and exit. -R, --root CHROOT_DIR Apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory. -s, --shell SHELL The name of the user's new login shell. Setting this field to blank causes the system to select the default login shell. If the -s option is not selected, chsh operates in an interactive fashion, prompting the user with the current login shell. Enter the new value to change the shell, or leave the line blank to use the current one. The current shell is displayed between a pair of [ ] marks. NOTE
The only restriction placed on the login shell is that the command name must be listed in /etc/shells, unless the invoker is the superuser, and then any value may be added. An account with a restricted login shell may not change her login shell. For this reason, placing /bin/rsh in /etc/shells is discouraged since accidentally changing to a restricted shell would prevent the user from ever changing her login shell back to its original value. FILES
/etc/passwd User account information. /etc/shells List of valid login shells. /etc/login.defs Shadow password suite configuration. SEE ALSO
chfn(1), login.defs(5), passwd(5). shadow-utils 4.5 01/25/2018 CHSH(1)

Check Out this Related Man Page

CHSH(1)                                                            User Commands                                                           CHSH(1)

NAME
chsh - change login shell SYNOPSIS
chsh [options] [LOGIN] DESCRIPTION
The chsh command changes the user login shell. This determines the name of the user's 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. OPTIONS
The options which apply to the chsh command are: -h, --help Display help message and exit. -R, --root CHROOT_DIR Apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory. -s, --shell SHELL The name of the user's new login shell. Setting this field to blank causes the system to select the default login shell. If the -s option is not selected, chsh operates in an interactive fashion, prompting the user with the current login shell. Enter the new value to change the shell, or leave the line blank to use the current one. The current shell is displayed between a pair of [ ] marks. NOTE
The only restriction placed on the login shell is that the command name must be listed in /etc/shells, unless the invoker is the superuser, and then any value may be added. An account with a restricted login shell may not change her login shell. For this reason, placing /bin/rsh in /etc/shells is discouraged since accidentally changing to a restricted shell would prevent the user from ever changing her login shell back to its original value. FILES
/etc/passwd User account information. /etc/shells List of valid login shells. /etc/login.defs Shadow password suite configuration. SEE ALSO
chfn(1), login.defs(5), passwd(5). shadow-utils 4.5 01/25/2018 CHSH(1)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

.bash_history

Question for all sysadmins. How do you keep track of what commands each user uses on his account. I thought an easy way is to monitor .bash_history, however those files can be "edited" by the user. Is there a permission combination that will allow the shell to record to it but yet they can't edit... (12 Replies)
Discussion started by: jason6792
12 Replies

2. UNIX for Dummies Questions & Answers

"no shell"

At the login prompt of a unix system I get no shell. The backup job ran without a new tape for three days, and when the user tries to logon the message "no shell" appears. Is the system in the wrong directory for login? (19 Replies)
Discussion started by: jweldin
19 Replies

3. Shell Programming and Scripting

how to connect to admin accout through script

hi everyone i'm running script in c-shell and i want this script to connect to admin account in order to run other script in k-shell. after that i want the script to be severed from the admin account and to continue with the regular commands example: my script call cs-customers echo"starting... (16 Replies)
Discussion started by: naamas03
16 Replies

4. Shell Programming and Scripting

How to identify User Machine name?

Hi Experts, We 4 to 5 people are using same UNIX(Solaris) login for our testing purpose. Also we are doing some modifications to existing scripts. Is it possible to know the each user machine (IP address or machine name) who are using the same login to modify the scripts. So that we can... (12 Replies)
Discussion started by: ganapati
12 Replies

5. Programming

Need some help with this...

I am trying to implement some kind of a which program. I could get the PATH environment variable and was able to tokenize it. I have a list of paths in tokens. Now, I have the name of the shell command. How would I search the tokens and display where the command was found? (41 Replies)
Discussion started by: Legend986
41 Replies

6. Shell Programming and Scripting

Change default shell

Hi all I am a total newbie at anything to do with shells or any form of scripting Unix/Linux etc. I have been trying to run through a tutorial on scripting but it requires the use of sh. My FreeNAS(FreeBSD) test box running the latest nightly build as an embedded install on CF card has csh as... (14 Replies)
Discussion started by: npaisnel
14 Replies

7. Shell Programming and Scripting

Users Not Logged in

I have searched the forums but have not mangaed to quite find what im looking for. I have used to /etc/passwd command to present me a list of all users the who command to present all users currently logged on, but what i want to know is what command can i use to display users that are registered... (12 Replies)
Discussion started by: warlock129
12 Replies

8. Shell Programming and Scripting

Removing Lines if value exist in first file

I tried a few ways to resolve this using a bash script w/ a loop, no luck. File1: roughly 6,000 account numbers such as: 1111 1512 1113 123 I also have a dozen or so csv files, w/ the account number in the 4th field. What I would like to do is remove all lines if the... (19 Replies)
Discussion started by: svn
19 Replies

9. Solaris

Password Expiry Promtps Not Visable

Hi all. On our systems we use the password expiry through the shadow file. This was recently implemented and the first round of expiry has just arrived. The problem that i have is that when users are attempting to log on to a box (directory through putty) there are no prompts displayed if... (13 Replies)
Discussion started by: boneyard
13 Replies

10. Solaris

su: No shell/No directory! if sys is added to a users secondary group

Hi, When I include a user to the secondary group "sys" GID=3 in Solaris 9 OS I'm not able to login. I get these error. The user home directory and the shell exists. Is this because of any security hardening. # su - agent No directory! # su agent su: No shell # grep taddm /etc/passwd... (14 Replies)
Discussion started by: agent001
14 Replies

11. AIX

Last login details in banner

Friends!! I need your help. Where can i change/set the last login details as below in aix 5.3. And how to do that to get the results as exactly below login as: mbpops mbpops@xx.28.3.24's password: Last unsuccessful login: Mon Nov 22 14:32:27 GMT 2010 on ssh from 10.132.5.129 Last login:... (17 Replies)
Discussion started by: kmvinay
17 Replies

12. Shell Programming and Scripting

Print arguments using array elements not working?

Hey guys, I'm new to shell scripting and I'm trying to write a script that takes user input and copies the specified columns from a data file to a new one. In order to account for the possibility of a variable number of columns to copy I wrote a loop that encodes the user's choices in an array... (16 Replies)
Discussion started by: shaner
16 Replies

13. Shell Programming and Scripting

Remove Space and blank line from file in UNIX shell script

I have below file. I want to remove space at begining of every line and then after also remove blank line from file. I use below code for each operation. sed -e 's/^*//' < check.txt > check1.txt sed '/^\s*$/d' < check1.txt > check2.txt above code not remove all the space... (12 Replies)
Discussion started by: Mohin Jain
12 Replies

14. Shell Programming and Scripting

Script as login shell (passing args to login shell)

Hello all, for security reasons my compagny imposes that my script be launch remotly via ssh under the users login shell. So serverA launches the ssh command to serverB which has a local user with my script as a login shell. Local script works like a charm on his own. serverB$ grep... (20 Replies)
Discussion started by: maverick72
20 Replies

15. Shell Programming and Scripting

Sudo password in shell file

Hi all, I have a script like this, where i am trying to login into oracle db via ssh and do a account unlock. #!/bin/sh ip=$1 os_user=$2 key=$3 ou_user=$4 ou_pass=$5 unlock_user=$6 ssh -i $key $os_user@$ip sudo -u $ou_user -p $ou_pass -- i am getting error here...its not taking... (16 Replies)
Discussion started by: onenessboy
16 Replies