1753797 Members
7477 Online
108805 Solutions
New Discussion юеВ

no shell prompt

 
Sandeep_Chaudhary
Trusted Contributor

no shell prompt

Not getting shell ($) prompt after entering username and password. this is nis user. this problem is only on one server for 1 user. but the same user can login on other server which are also under NIS.
5 REPLIES 5
Matti_Kurkela
Honored Contributor

Re: no shell prompt

From the expected "$" prompt, I guess the user's shell is probably sh or ksh, or some other Bourne-type shell that uses /etc/profile.

Does the user have a customized .profile or other login script?

The user might have included something equivalent to "unset PS1" or "PS1=''" to his login script, which would make the user's prompt a null string. This is a common result when the user is learning to customize his/her shell prompt and makes a mistake. I did this once or twice when I was a Unix newbie :-)

Or the user's login script might contain some commands that cause an endless loop or recursion, so the shell can never reach the end of the login script.

To see what's going on, the sysadmin might temporarily add something like this to /etc/profile (replace "testuser" with the username of the user that has the problem):

if [ $(whoami) = "testuser" ]; then
set -x
fi

This will cause all login script commands to be echoed to the screen just before executing them, so the script execution can be traced.

Such a debugging output may prevent the user from using tools like scp, rcp or rdist, so remember to remove the extra commands from /etc/profile once the problem is solved.

MK
MK
Laurent Menase
Honored Contributor

Re: no shell prompt

2 ideas:
1) if it is autofs mounted user home directory,
check if the home can be mounted
2) often it is opening mail inbox, so check if the inbox is not locked for instance.
Dennis Handly
Acclaimed Contributor

Re: no shell prompt

Can you logon with another user and use ps(1) to see what the hung user is doing?
UNIX95=EXTENDED_PS ps -H -fu hung-user

It could be hung on quotas. Do you see the /etc/motd? Do you have any output from ~/.profile that could give you any idea where it is hanging?

>Laurent: if it is autofs mounted user home directory

Typically if this happens, it will log you in to / and tell you that it couldn't cd to your home directory.
Laurent Menase
Honored Contributor

Re: no shell prompt

@Dennis no autofs hard mount with stale server cause loggin to hang.
Dennis Handly
Acclaimed Contributor

Re: no shell prompt

>Laurent: no, autofs hard mount with stale server cause login to hang.

Possibly. I have NIS automounted home directory and many times I login without my home directory. Not sure if hard mounted?