Operating System - HP-UX
1837243 Members
4775 Online
110115 Solutions
New Discussion

"No shell" error when a user try to login

 
SOLVED
Go to solution
Lai Siew Yuen
Frequent Advisor

"No shell" error when a user try to login

I have a HPUX version 11.0 running fine all the while. Out of sudden, all users (except root privilege users) are not able to telnet to the server. The error received is as follow:
"No shell
Bus error"
The telnet session will then exit within 10 sec. I tried to login with root and is able to do so.
Appreciate your kind advice on this matter.
Thanks in advance.
12 REPLIES 12
whiteknight
Honored Contributor

Re: "No shell" error when a user try to login

Lai,

One cause of 'No shell' for login/su can be a space
at the end of an entry in the password file (/etc/passwd)
associated with the user.

Another cause is /usr set to 744 (i.e. drwxr-r--). After
adding execute for group and others (i.e. chmod 755 /usr),
su and login/telnet/rlogin worked again without complaint.

So, if /, /usr, or /usr/bin are set to 744 or 644 (i.e.
not executable by others), su and login will fail with
"No shell".

my 2 cents
WK
Problem never ends, you must know how to fix it
Lai Siew Yuen
Frequent Advisor

Re: "No shell" error when a user try to login

Thanks to WK for your prompt response. I've checked that there is no space after the last entry in the /etc/passwd file associated with the user. I've also changed the mode of /usr to 755 (originally was 666). But the problem still persists.
Thanks & Regards.
Steven Schweda
Honored Contributor
Solution

Re: "No shell" error when a user try to login

What is the shell specified in /etc/passwd
(or NIS, or wherever) for a problem user?

What are the permissions on that shell and on
the directories leading down to it?

> I've also changed the mode of /usr to 755
> (originally was 666).

If /usr wasn't 755, then I'd guess that
someone changed it. If someone changed that,
then someone could have changed anything.

> [...] all users (except root privilege
> users) [...]

I know nothing, but it sounds as if you may
have too many root privilege users.
Yogeeraj_1
Honored Contributor

Re: "No shell" error when a user try to login

hi,

What error do you get when you logon as root and do a 'su - user'

revert

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Steven Schweda
Honored Contributor

Re: "No shell" error when a user try to login

Around here (11.11), "man login" says:

[...]
DIAGNOSTICS
The following diagnostics appear if the associated condition occurs:
[...]
No shell

The user shell (/usr/bin/sh if shell name is null in /etc/passwd)
could not be started with the exec command. Consult system
administrator.
[...]


Which suggests that the specified shell is
bad somehow, which could include permission
problems of various kinds.
Anshumali
Esteemed Contributor

Re: "No shell" error when a user try to login

Did you happen to check /etc/shells?
Dreams are not which you see while sleeping, Dreams are which doesnt allow you to sleep while you are chasing for them!!
Dennis Handly
Acclaimed Contributor

Re: "No shell" error when a user try to login

>Steven: What are the permissions on that shell and on the directories leading down to it?

And /usr/lib, etc.

>If someone changed that, then someone could have changed anything.

Right, time to use "swverify \*".
(And after collecting the info, add -F to fix the permissions.)
Lai Siew Yuen
Frequent Advisor

Re: "No shell" error when a user try to login

Hi all, thank you all for your replies. Here are the answers:
1. The shell specified is /usr/bin/ksh.
Permission for /usr/bin is drw-rw-rw- (666).
2. Permission for ksh is r-xr-xr-x (555).
3. The error is "su:No shell
Bus error"
4. There is no "/etc/shells"
5. Permission for /usr/lib is
drw-rw-rw- (666).
Thanks & Regards.
Steven Schweda
Honored Contributor

Re: "No shell" error when a user try to login

> Permission for /usr/bin is drw-rw-rw- (666).

Around here, it looks like this:

dy # ls -ld /usr/bin
dr-xr-xr-x 5 bin bin 16384 Nov 20 01:17 /usr/bin

I have a non-root user with the shell
/usr/local/bin/bash, and changing the
permissions on /usr/local/bin to 666 gives
me a problem like yours:

dy # ls -ld /usr/local/bin
drwxrwxr-x 2 bin bin 8192 Oct 24 10:56 /usr/local/bin
dy # su sms
dy # exit
dy # exit
dy # chmod 666 /usr/local/bin
dy # su sms
su: No shell
dy #

Someone seems to have messed up your stuff
pretty badly. Because none of us knows
exactly _how_ badly (or where), I like the
swverify suggestion.
Dennis Handly
Acclaimed Contributor

Re: "No shell" error when a user try to login

>1. The shell specified is /usr/bin/ksh.
>Permission for /usr/bin is drw-rw-rw- (666).
>5. Permission for /usr/lib is drw-rw-rw- (666).

As suspected by WK & Steven, your system is seriously broken! You should do:
# swverify -F \*

You may have to repair a few directories first:
# chmod a+x / /usr/lib /usr/bin
Steven Schweda
Honored Contributor

Re: "No shell" error when a user try to login

Then change the root password, and don't
tell so many people what it is. (Or, if
_you_ messed up this stuff, get someone else
to change the root password, and not tell
_you_ what it is.)
Lai Siew Yuen
Frequent Advisor

Re: "No shell" error when a user try to login

Thank you everyone for your kind advice. After checking through the folders, I realised that the /usr/lib folder has the wrong owner (not sure why it became 666). I corrected it to bin and everything is fine now. Thanks once again for your kind help.