- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: how to change user's shell
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2002 05:53 PM
02-24-2002 05:53 PM
i want to change it to /sbin/sh
i use root to change it in /etc/passwd
but when i use A login ,the shell is still /usr/bin/sh
what should i do?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2002 05:56 PM
02-24-2002 05:56 PM
Re: how to change user's shell
Verify the change by typing:
# grep userid_A /etc/passwd
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2002 06:07 PM
02-24-2002 06:07 PM
Re: how to change user's shell
To be on the safe side, always use the vipw command when changing the /etc/passwd.
Hope this helps. Regards.
Steven Sim Kok Leong
Extracted man page information for your convenience:
vipw edits the password file while setting the appropriate locks, and does any necessary processing after the password file is unlocked. If the password file is already being edited, you will be told to try again later. The vi editor is used unless the environment variable EDITOR indicates an alternate editor. vipw performs a number of consistency checks on the password entry for root, and does not allow a password file with an incorrectly formatted root entry to be installed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2002 06:10 PM
02-24-2002 06:10 PM
Re: how to change user's shell
and this change has done
what command i can use to show which shell i am using now?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2002 06:14 PM
02-24-2002 06:14 PM
Re: how to change user's shell
The following will indicate the shell you are currently using:
# ps -fp $$
Using echo $SHELL is unreliable eg. after you run another child shell in your login session.
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2002 06:22 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2002 06:25 PM
02-24-2002 06:25 PM
Re: how to change user's shell
SHELL is not set there.
After you logon as A, type "echo $SHELL" to
check the current shell you are using.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2002 06:26 PM
02-24-2002 06:26 PM
Re: how to change user's shell
UID PID PPID C STIME TTY TIME COMMAND
snmp 5994 5993 1 10:29:29 pts/ta 0:00 -sh
after root change shell ,and use vipm
ps -fp $$
UID PID PPID C STIME TTY TIME COMMAND
snmp 5994 5993 1 10:29:29 pts/ta 0:00 -sh
nothing happen?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2002 06:30 PM
02-24-2002 06:30 PM
Re: how to change user's shell
/sbin/sh and /usr/bin/sh functions similarly.
ps -fp $$ is good in identifying child shells:
$ /sbin/sh
$ ps -fp $$
UID PID PPID C STIME TTY TIME COMMAND
xyz 7600 4268 0 10:29:59 pts/0 0:00 /sbin/sh
$ /usr/bin/sh
$ ps -fp $$
UID PID PPID C STIME TTY TIME COMMAND
xyz 7658 7600 0 10:30:09 pts/0 0:00 /usr/bin/sh
For the login shell, using echo $SHELL works if it has not been tampered with ie. you can set in your /etc/profile:
readonly SHELL
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2002 06:36 PM
02-24-2002 06:36 PM
Re: how to change user's shell
What I meant is that -sh will appear regardless of whether it is /sbin/sh or /usr/bin/sh in your process list if one of them is used as the login shell.
If you have lsof installed, you can identify the binary used by:
# lsof|grep $$
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2002 07:57 PM
02-24-2002 07:57 PM
Re: how to change user's shell
chsh
The sbin versions of commands (and the POSIX shell sh) are archived libraries which means they will occupy slightly more RAM as they don't share common library functions. Otyher than the RAM increase, there is no downside to using the /sbin/sh shell. The uoside (for root only) is that this shell is mandatory in single user mode as /usr/lib is not mounted.
Bill Hassell, sysadmin