Operating System - HP-UX
1753383 Members
5700 Online
108792 Solutions
New Discussion

Re: Change the shell of some user ???

 
SOLVED
Go to solution
itrc55
Regular Advisor

Change the login path of some user ???

Hi Team,

 

i create user "ilink" with this home directory /comptel/ilink, i want this user go to other path "/usr/local/bin/bash" when i login with it without changing the home directory.

How  i can do it that ?

 

Thanks

 

8 REPLIES 8
Torsten.
Acclaimed Contributor

Re: Change the login path of some user ???

"/usr/local/bin/bash" is likely a binary, not a directory. I don't see a reason for doing this, but consider to set the pwd in the users profile.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
itrc55
Regular Advisor

Re: Change the login path of some user ???

 

Hi,

 

i want to change the user shell permanently to bash shell /usr/local/bin/bash for ilink user only

i  try to change user shell from /sbin/sh to bash in HP ux 11.31 bash location is /usr/local/bin/bash
i used smh but this shel is not available on the list

How i can do it that ??

 

Thanks

Dennis Handly
Acclaimed Contributor

Re: Change the shell of some user ???

>I want to change the user shell permanently to bash shell /usr/local/bin/bash for ilink user only

 

You or that user can use chsh(1).

You may have to put that shell in /etc/shells.

Torsten.
Acclaimed Contributor

Re: Change the shell of some user ???

Adjust the /etc/passwd file.


Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
itrc55
Regular Advisor
Solution

Re: Change the shell of some user ???

Hi,



more /etc/shells
/etc/shells: No such file or directory



but i edit the /comptel/ilink/.profile and i add this lines



=========

. sas/.profile
/usr/local/bin/bash
stty erase "^?" kill "^U" intr "^C" eof "^D"

=========



And how to assign point on this new forums ?



Thanks
Dennis Handly
Acclaimed Contributor

Re: Change the shell of some user ???

>/etc/shells: No such file or directory

 

You need to create this file and add the default shell and your new one.  See shells(4) and getusershell(3C).

 

>And how to assign point on this new forums ?

 

Click on the kudos star next to the replies.

http://h30499.www3.hp.com/t5/Tips-and-Tricks/Kudos-what-where-how-and-why/m-p/4803621

Hakki Aydin Ucar
Honored Contributor

Re: Change the login path of some user ???

I believe the only thing to remember during a bash shell profile assignment , restrict yourself to give bash profile a superuser like root.

Bill Hassell
Honored Contributor

Re: Change the shell of some user ???

> ...added to profile...

   > . sas/.profile
   > /usr/local/bin/bash
   > stty erase "^?" kill "^U" intr "^C" eof "^D"

This is not a good way to change shells. The command chsh as mentioned above is designed to do exactly what you want and does not require root privileges. In the example above, the current shell will start a sub shell and the stty commands will only be run AFTER you exit from bash. Just remove the bash line and run this command:

 

   chsh myuser /usr/local/bin/bash

 

From now on, myuser will login and be given bash as their shell.

 

Note that /etc/shells does not normally exist. You create this file when you start using non-standard shells. The starting point for this file is found in the man page for getusershell, but you can just copy-paste this list and add /usr/local/bin/bash to the end:

 

/sbin/sh
/bin/sh
/bin/ksh
/bin/false
/usr/bin/sh
/usr/bin/rsh
/usr/bin/ksh
/usr/bin/rksh
/usr/bin/csh
/usr/bin/rcsh
/usr/bin/keysh

 



Bill Hassell, sysadmin