1834448 Members
1919 Online
110067 Solutions
New Discussion

login problem

 
yatin
Frequent Advisor

login problem

I made some changes to /etc/passwd now I get error message as NO SHELL I was using root a/c
and I donot have any other a/c
11 REPLIES 11
Clemens van Everdingen
Honored Contributor

Re: login problem

Hi,

Did you change by accident the shell for the root user to /sbin/ksh instead of /sbin/sh ?

If yes you need to reboot the system into single user mode and correct this.

C.
The computer is a great invention, there are as many mistakes as ever, but they are nobody's fault !
V.Tamilvanan
Honored Contributor

Re: login problem

Hi,
You need to cold restart the system and boot through single user mode by using hpux -is on ISL prompt and copy back your old passwd file or add the entry /sbin/sh at the Shell entry in /etc/passwd file.
Michael Tully
Honored Contributor

Re: login problem

DO NOT REBOOT your system. You need to put the entry back. The entry *must* read as /sbin/sh as the shell. Nothing else will work.
Anyone for a Mutiny ?
KapilRaj
Honored Contributor

Re: login problem

U have changed the root user's shell;

Undo the changes and put it back as it was

Regds,

Kaps
Nothing is impossible
Roberto Polli
Trusted Contributor

Re: login problem

Michael ,
on my hpux I use /usr/bin/ksh as root shell, and it works.
Sure I agree with you that /sbin/sh can be a better choiche but I neve had problem, even on hd failure, using such a shell.

Peace, R.
Elmar P. Kolkman
Honored Contributor

Re: login problem

DO NOT USE /usr/... as a shell !!!

You won't be able to boot in LVM maintenance mode. If you want to use a /usr/... program as a shell for root, put something like this in his .profile:
[ -x /usr/bin/ksh ] && exec /usr/bin/ksh

That way, if /usr is not (yet) mounted, you have at least a working root account.

As for the problem itself: it might be a change to the shell of the user that is caused by putting a colon (:) extra on or removing a colon from a line... Make sure the first line looks right, having the right number of colons. And of course a correct executable shell.
Every problem has at least one solution. Only some solutions are harder to find.
SANTOSH S. MHASKAR
Trusted Contributor

Re: login problem

Hi Yatin,

It is a bad practice to edit /etc/passwd if u r a novice. Just change the shell to /sbin/sh by editing /etc/passwd.

Roberto any shell will work but the thing is it should exist.

-Santosh
SS_6
Valued Contributor

Re: login problem

Hi Yatin,What I uderstand is you are not able to login to system at all so there is no question of changing anything unless you log into the system.
Try rebooting system in single user mode and make shell chnages to passwd file for root user.
By providing solutions I am helping myself
A. Clay Stephenson
Acclaimed Contributor

Re: login problem

Roberto, I assure you that you did not change root's shell (Here I am assuming that root is UID 0) and boot sucessfully. First of all, /usr would not even be mounted at boot. Now you might have done an exec /usr/bin/ksh in root's .profile but that is different. The fundmental problem is that a statically linked version of the shell must be available for the times before the other filesystems are mounted. /sbin/sh is a fully functional version of the POSIX shell; /usr/bin/sh is a dynamically linked version of the same shell and it used by other users to save memory.

It would be possible to create a statically linked version of ksh or bash and make an entry in /etc/shells and install them in /sbin.

Most people do this out of the mistaken belief the /sbin/sh is a Bourne shell; it is instead a fully functional POSIX shell which is for all intents and purposes a Korn shell.
If it ain't broke, I can fix that.
Steve Lynn
New Member

Re: login problem

Goto /etc/default/passwd copy this default login file to /etc/passwd and change passwd for root.

This will enable the correct shell as built by HP

PS.
Create another account with root privs

Regards

Steve
generic_1
Respected Contributor

Re: login problem

You can use sam if you are a novice and then go look at the sam logs to see what commands it ran. You could also compare an old copy to the new in additoin to your reading of the man pages. Before editing the password file in the future you may want to consider cp /etc/passwd /etc/passwd.old just in case. This is a good practice whenever editing almost any kind of file.