Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

su - gives No Directory Error 1

Status
Not open for further replies.

bluedragon2

IS-IT--Management
Jan 24, 2003
2,642
0
0
US
I have an account that when I su to it works fine, but when I su - to it, I get a No Directory error.

The account has a home directory with perms 755.

[Blue]Blue[/Blue] [Dragon]

If I wasn't Blue, I would just be a Dragon...
 
grep bba /etc/passwd

bba:x:104:104:Billy Bathgate:/home/bba:/usr/bin/ksh

Using "su - bba" will authticate and use "/home/bba" as the home directory.

You will need to make sure the directory exists and that an environment is setup by the "/home/bba/.profile" when you login.

A great teacher, does not provide answers, but methods to teach others "How and where to find the answers"

bsh

36 years Bell, AT&T, Lucent, Avaya
Tier 3 for 26 years and counting
 
The correct directory is in the passwd file and the directory has the correct perms. Their is no .profile file for this account.

When I run truss, it errors out at the following:

fcntl(4, F_DUPFD, 0x00000100) Err#22 EINVAL
read(4, " # i d e n t\t " @ ( #".., 1024) = 1024
read(4, " y t h o s e\n # f u n".., 1024) = 211
read(4, 0xFF342400, 1024) = 0
close(4) = 0
getuid() = 0 [0]
getuid() = 0 [0]
door_info(3, 0xFFBFF688) = 0
door_call(3, 0xFFBFF730) = 0
setgroups(1, 0x000302A0) = 0
setuid(1002) = 0
chdir("/var/NMS/tmp/s100") Err#13 EACCES [file_dac_search]
fstat64(2, 0xFFBFEEB8) = 0
su: write(2, " s u : ", 4) = 4
No directory!write(2, " N o d i r e c t o r y".., 13) = 13


The home dir is /var/NMS/tmp/s100


[Blue]Blue[/Blue] [Dragon]

If I wasn't Blue, I would just be a Dragon...
 
show grep command for the login name on /etc/passwd
grep s100 /etc/passwd
show
ls -al /var/NMS/tmp/s100

A great teacher, does not provide answers, but methods to teach others "How and where to find the answers"

bsh

36 years Bell, AT&T, Lucent, Avaya
Tier 3 for 26 years and counting
 
# grep s100 /etc/passwd
nwkdata:x:1002:1001::/var/NMS/tmp/s100:/bin/sh

# ls -al /var/NMS/tmp/s100
total 4
drwxr-xr-x 2 nwkdata users 512 Jun 1 2007 .
drwxr-xr-x 5 nwkdata users 512 Jun 1 2007 ..


[Blue]Blue[/Blue] [Dragon]

If I wasn't Blue, I would just be a Dragon...
 
ls -l /var | grep NMS
ls -l /var/NMS | grep tmp
ls -l /var/NMS/tmp | grep s100

all of these must have permissions to allow nwkdata to cd to them


A great teacher, does not provide answers, but methods to teach others "How and where to find the answers"

bsh

36 years Bell, AT&T, Lucent, Avaya
Tier 3 for 26 years and counting
 
# ls -l /var | grep NMS
drwxr-x--- 3 root root 512 Jun 1 2007 NMS

# ls -l /var/NMS | grep tmp
drwxr-xr-x 5 nwkdata users 512 Jun 1 2007 tmp

# ls -l /var/NMS/tmp | grep s100
drwxr-xr-x 2 nwkdata users 512 Jun 1 2007 s100


[Blue]Blue[/Blue] [Dragon]

If I wasn't Blue, I would just be a Dragon...
 
chmod 755 /var/NMS should fix this
you will have to be root

A great teacher, does not provide answers, but methods to teach others "How and where to find the answers"

bsh

36 years Bell, AT&T, Lucent, Avaya
Tier 3 for 26 years and counting
 
Thanks,

I thought they were all 755, but overlooked that one.

Thanks again.

[Blue]Blue[/Blue] [Dragon]

If I wasn't Blue, I would just be a Dragon...
 
I think u dont have a root access dats why
because login through su will give access to home directory and logn throuh su - , will give access to rot directory
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top