Operating System - HP-UX
1836644 Members
1802 Online
110102 Solutions
New Discussion

when ogin into user its going to root directory

 
Ramana.Sv
Frequent Advisor

when ogin into user its going to root directory

Hi, i created one user "Ramana", when i log into Ramana user its going to "/" (root) directory, its not going Ramana, wher is the mistake? pls


Thnak you,
Ramana

22 REPLIES 22
Ivan Krastev
Honored Contributor

Re: when ogin into user its going to root directory

See user home directory in /etc/passwd.
If it's missing create dir and change to desired value with usermod or vipw.


regards,
ivan
Ed D
Occasional Advisor

Re: when ogin into user its going to root directory

Hi,

It could be a permission problem with /home or /home/ramana or an error in /etc/passwd for user ramana. Do you want to post:
ls -ld /home
ls -ld /home/ramana
grep ramana /etc/passwd

Ed
Ramana.Sv
Frequent Advisor

Re: when ogin into user its going to root directory

mean iam not getting please xplain clearly,

Pete Randall
Outstanding Contributor

Re: when ogin into user its going to root directory

The user's home directory is specified in /etc/passwd:

#grep "Ramana" /etc/passwd
Ramana:RMME3ZGeVQz2c:112:200:,,,:/home/Ramana:/usr/bin/sh

If the passwd entry contains an invalid or non-existent home directory then the login process will be unable to send them to the desired directory and they will end up in / instead.

Is that clear enough?


Pete

Pete
AwadheshPandey
Honored Contributor

Re: when ogin into user its going to root directory

Ramana,

Can you explain the process how you have created the user, I think there is some issue in creating user itself.

Sol:
create a directory mkdir /home/Ramana
then vi /etc/passwd and change the home dir field to /home/Ramana.
chown Ramana:users(group)/home/Ramana
it will do the things you need.
command to add user should be
useradd -c "Ramana Sv" -d /home/Ramana -m Ramana

Regards,

Awadhesh
It's kind of fun to do the impossible
MarkSyder
Honored Contributor

Re: when ogin into user its going to root directory

When I've seen problems like this it's usually because the home directory is on an NFS mount which is currently unavailable.

cd without a directory name should take you to the home directory. Log in as Ramana, type cd, and report the result.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
Dennis Handly
Acclaimed Contributor

Re: when ogin into user its going to root directory

>Mark: When I've seen problems like this it's usually because the home directory is on an NFS mount which is currently unavailable.

Right, or the automounter went belly up.
Ramana.Sv
Frequent Advisor

Re: when ogin into user its going to root directory

I try out this command but its giving the following message.

India # grep murali /etc/passwd
murali:hlXNS4glU9nn6:104:20::/home/murali:/sbin/sh


please help me sir how to do this one
pease tell me the comand
bassical i used command to create user is
adduser ramana
passwd ramana
that's it only.....
Pete Randall
Outstanding Contributor

Re: when ogin into user its going to root directory

That looks correct:

murali:hlXNS4glU9nn6:104:20::/home/murali:/sbin/sh

The first field is the user name, murali. The second field is the password hash, hlXNS4glU9nn6. Then we have the uid and gid. The "gecos" fields are blank. Then we have the home directory, /home/murali, and finally the login shell.

What does

ll -d /home/murali

show?


Pete

Pete
Robert-Jan Goossens
Honored Contributor

Re: when ogin into user its going to root directory

Hi,

# cd /home/murali
does this directory exist ?

# mkdir /home/murali
# chown murali:20 murali /home/murali

Robert-Jan

Dennis Handly
Acclaimed Contributor

Re: when ogin into user its going to root directory

You of course can use SAM to create users and it will make sure the home directory is built correctly and populated with the initial "." files for the shells and vi.
Geoff Wild
Honored Contributor

Re: when ogin into user its going to root directory

As Robert-Jan says - it sounds like the home dir wasn't created.

just make it:

mkdir /home/ramana


then copy .login, .profile from say another user into that directory and then:

chown -R ramana:users /home/ramana

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Ramana.Sv
Frequent Advisor

Re: when ogin into user its going to root directory

when i use this command ll -d /home/murali
it giving the like this follwing.

drwxrwxr-x 2 murali users 96 Aug 3 18:27 /home/murali
Robert-Jan Goossens
Honored Contributor

Re: when ogin into user its going to root directory

Ramana,

# cd /home/murali
# df -k .
please post the ouput from the df -k . command
Dave Hutton
Honored Contributor

Re: when ogin into user its going to root directory

Actually this looks wrong to me:
murali:hlXNS4glU9nn6:104:20::/home/murali:/sbin/sh


I thought only root user should be using /sbin/sh.

Normal users I thought are all supposed to use /usr/bin/sh

For the heck of it when you log in as your user what does $echo $SHELL show?
Pete Randall
Outstanding Contributor

Re: when ogin into user its going to root directory

Dave,

That's true that normal users ought to be using /usr/bin/sh, but /sbin/sh will work without causing any problems.


Pete

Pete
Dave Hutton
Honored Contributor

Re: when ogin into user its going to root directory

Pete, you are correct. I tested it after I posted and like you suggested it didn't cause my account to use /

I should of tested it prior.
Ramana.Sv
Frequent Advisor

Re: when ogin into user its going to root directory

iam getting this error
"/tmp/SEDC/murali_4834/Ex07425" Permission denied
Dave Hutton
Honored Contributor

Re: when ogin into user its going to root directory

what are the permissons on the file?
ll /tmp/SEDC/murali_4834/Ex07425

bdf /tmp is tmp full?


Ramana.Sv
Frequent Advisor

Re: when ogin into user its going to root directory

no having more space..

/dev/vg00/lvol6 5242880 979056 3997339 20% /tmp

Dave Hutton
Honored Contributor

Re: when ogin into user its going to root directory

Actually my above post I was thinking two different things. I didn't mean to ask what is $SHELL set at. What I did mean to ask is what does echo $HOME show?

I'm wondering by the other how to change HOME thread something didn't get messed up.
Dennis Handly
Acclaimed Contributor

Re: when ogin into user its going to root directory

>I am getting this error
"/tmp/SEDC/murali_4834/Ex07425" Permission denied

What was the command you used?

>Dave: what are the permissons on the file?
/tmp/SEDC/murali_4834/Ex07425

Right.
This error can occur if TMPDIR isn't set correctly:
$ mkdir -p /tmp/SEDC/murali_4834
$ chmod a-x /tmp/SEDC/murali_4834
$ TMPDIR=/tmp/SEDC/murali_4834 vi himom.C
"/tmp/SEDC/murali_4834/Ex25745" Permission denied

So make sure TMPDIR is something like just /var/tmp. Or if you really have your heart set on /tmp/SEDC/murali_4834/, make sure you have execute permission on the directory paths.

You may have something like:
export TMPDIR=/tmp/SEDC/$LOGNAME_$$ ??