Operating System - HP-UX
1748235 Members
3373 Online
108759 Solutions
New Discussion юеВ

Re: Want to change login shell

 
rohit kumar gupta
Occasional Contributor

Want to change login shell

I want to change login shell of a user .
but some process of thaat user are running , so i am unable to change shell by using usermod command.
I dont have to kill user's process and i dont want to manually edit /etc/passwd file using vi or vipw command .
Plz let me know if there is any other way as soon as possible.
5 REPLIES 5
Horia Chirculescu
Honored Contributor

Re: Want to change login shell

Hello,

>I dont have to kill user's process and i dont want to manually edit /etc/passwd file using vi or vipw command .

You are talking about login shell.

This means that the user must log off (the session must be closed) and only after log on again he would use the shell you specify as login shell.

Login shell is specified in /etc/passwd and it does not matter how you will edit/change the corresponding record from that file.

Horia.
Best regards from Romania,
Horia.
AVV
Super Advisor

Re: Want to change login shell

Hi Rohit,

Exactly as said above. You will either have to edit the /etc/passwd or recreate the user to change the shell after exiting the current user session.
Dennis Handly
Acclaimed Contributor

Re: Want to change login shell

You or the user in question should simply use chsh(1).

The next time the user logs in, he will get the new shell.
(I assume you know you should never change the login shell for root.)
rohit kumar gupta
Occasional Contributor

Re: Want to change login shell

Thanks for your quick response .
My problem is resolved .
I can use usermod along with -F option .
Thanks guys
Dennis Handly
Acclaimed Contributor

Re: Want to change login shell

>I can use usermod along with -F option.

Looks like a new option on 11.31.