1833017 Members
2191 Online
110048 Solutions
New Discussion

Re: No Shell. ERROR

 
ashwin
Occasional Contributor

No Shell. ERROR

hi to everybody,


I am having hp-ux10.x , when I am trying to login as other than root, Getting Error
No shell.


pl help.


11 REPLIES 11
Alex Glennie
Honored Contributor

Re: No Shell. ERROR

When trying to login to my system as a normal user, I receive the
following error message:

No Shell

If I login as a root user, this message is not displayed. Why ?

Solution

This error indicates that exec failed from login. The most likely
causes are:

A. Missing or corrupted /etc/passwd file

or

B. Permissions wrong on the shell, directories or file

The following table shows correct permissions for the shell,
the directories involved with login, and the passwd file:

File or Directory Correct Access

/bin/sh -r-xr-xr-t
/ drwxr-xr-x
/bin drwxr-xr-x
/etc/passwd -r--r--r--
Andreas Voss
Honored Contributor

Re: No Shell. ERROR

Hi,

look in /etc/passwd at the line of the user for the last column - this is the login shell and check if this exists at the system.

Regards
James R. Ferguson
Acclaimed Contributor

Re: No Shell. ERROR

Hi:

Check the seventh field (colon-delimited) of /etc/passwd for the user (first field) in question. You should have a valid shell or program specified. For the POSIX shell (the default) you should have:

/usr/bin/sh

The error you report generally means that no shell (or startup program) has been specified.

Make sure that the ownership of the shell is "bin:bin" and that the permissions are "-r-x-r-x-r-x".

...JRF...
...JRF...
John Sisak
Advisor

Re: No Shell. ERROR

I had this problem once and it was caused by incorrect permissions on / as Alex mentioned.
ls -ld / should also show root sys ownership.
Danny Engelbarts
Frequent Advisor

Re: No Shell. ERROR

Ashwin,

Has the system booted properly last reboot? it could be the /usr filesystem isn't mounted. Check with bdf if all filesystems are mounted and if not check /var/adm/syslog/syslog.log for error messages during boot. Otherwise the shell might be missing, root uses the /sbin/sh whereas other users usually use one of the shells in /usr/bin/

Regards, Danny
Jeffrey S. Sims
Trusted Contributor

Re: No Shell. ERROR

Hi ashwin,

root uses /sbin/sh, try changing one of your other users in the /etc/passwd file to /bin/sh and see if it works, you make not have the other shells available for some reason (corruption, wrong path, accidents etc.)
Bill Hassell
Honored Contributor

Re: No Shell. ERROR

Just a note about /bin/sh...there isn't a directory with this name (hasn't been for almost 8 years). /bin on 10.x and 11.x systems is either missing completely (as defined by the SysV.4 standard) or is actually a symbolic link. Try this:

ll -d /bin

The correct directory is /usr/bin. Every script and reference concerning /bin paths should be updated to /usr/bin. If the symbolic link is removed (man tlremove) then anything with a /bin (and /lib and a *LOT* more) will fail. It's been a long time since the directory and filename change(s) were implemented.


Bill Hassell, sysadmin
Shannon Petry
Honored Contributor

Re: No Shell. ERROR

I second what Bill has to day, and will give a couple of additional notes about apps which create their own users.

CATIA is a prime example where if you create users, their default shell is set to /bin/ksh. This model fits fine on an IBM running AIX and Solaris, but does not work on HP-UX or Irix.

CGS, PDGS and many other apps which create user ID's for you can cause these problems. While they understand the basic name:pass:uid:gid..blah.blah.. they do not usually check to see if the shells are really there, nor give you the option to change the shell.

Make sure that all users except root (who has a shell of "/sbin/sh") have shells of "/usr/bin/ksh", "/usr/bin/csh", "/usr/bin/rsh", "/usr/bin/sh" if they need to login to the box. FTP users and mail users not needing a shell should have a shell of "/usr/bin/false".
It helps too to update "/etc/shells" and put the entries in it that your site is using.

Regards,
Shannon
Microsoft. When do you want a virus today?
Guillermo Castillo
New Member

Re: No Shell. ERROR

Hi, you can chek if in the last letter of the line you have the end or a blank space, if you have a blank space, yo dont have a shell /sbin/sh_ (where _ means a blank space) I had the same problem a long time ago, here?s an example of a passwd file

root:5StR.vARQsoIY:0:3::/:/sbin/sh
daemon:*:1:5::/:/sbin/sh
bin:*:2:2::/usr/bin:/sbin/sh
sys:*:3:3::/:
adm:*:4:4::/var/adm:/sbin/sh
uucp:*:5:3::/var/spool/uucppublic:/usr/lbin/uucp/uucico
lp:*:9:7::/var/spool/lp:/sbin/sh
nuucp:*:11:11::/var/spool/uucppublic:/usr/lbin/uucp/uucico
hpdb:*:27:1:ALLBASE:/:/sbin/sh
nobody:*:-2:-24::/:
catadm:ihXmBjK719E1M:301:301::/home/catadm:/bin/ksh
catusr:TgiCsf7/deSaY:302:301::/home/catusr:/bin/ksh
tftp:*:510:1:Trivial FTP user:/home/tftpdir:/usr/bin/false
imagen:,..:345:301::/ftp/catia/imagen:/usr/bin/ksh
iadrian::1477:301:Prof. Ignacio Adrian Romero:/home/hpmec/mc0/iadrian:/usr/bin
al499903:aLi9r2h.jsdRI:18550:301:Ulises Bastida Torres - TME98:/home/hpmec/al3/um0/al499903:/usr/bin/ksh
al448021:IOSPxJTkbtU0g:31562:301:Villegas Morales Jose Angel:/home/hpmec/al1/um2/al448021:/usr/bin/ksh
al454574:WtFXmtZ29cVRU:11550:301:Jonathan Josue Colin Gonzalez - PBL95:/home/hpmec/al4/um7/al454574:/usr/bin/ksh
Vincenzo Restuccia
Honored Contributor

Re: No Shell. ERROR

Edit /etc/passwd and verify the full path shell (es. /usr/bin/ksh).
Ron D.
Frequent Advisor

Re: No Shell. ERROR


If you setup another user with membership to group root, login as that user and issue the command:
'newgrp root' then execute SAM and change the shell for root to /sbin/sh. This should put things back to an operable state.