1832274 Members
1984 Online
110041 Solutions
New Discussion

Permission on /tmp

 
logaraman
Regular Advisor

Permission on /tmp

Hi ,

I am a beginner on HP.. I give 777 on all files on directories on /tmp and when I logout and login I see the permission as 677.

Why is it? Even a file or a directory owned by root faces the same issue.
20 REPLIES 20
Stephen Keane
Honored Contributor

Re: Permission on /tmp

What is your umask set to ?

# umask
Fabio Ettore
Honored Contributor

Re: Permission on /tmp

Hi,

it is really strange since permissions on /tmp always should be 777.
Something into /.profile to launch chmod?

Can you post output by

ll -d /tmp

It also should be owner 'bin' and group 'bin' (bin:bin).

Best regards,
Fabio
WISH? IMPROVEMENT!
Fabio Ettore
Honored Contributor

Re: Permission on /tmp

...and what HP-UX version is you system? Do you have other HP-UX system with this problem?

Best regards,
Fabio
WISH? IMPROVEMENT!
logaraman
Regular Advisor

Re: Permission on /tmp

Hi All, thanks for ur replies.


The umask is 022.

I tried changing the owner to bin and bin but still the same issue.. The version is HP 11.23
Stephen Keane
Honored Contributor

Re: Permission on /tmp

If you create a file in /tmp and chmod it to 777, when you reboot, it has permission 677? If so, look at the timestamp of the file and compare it to the boot log (/etc/rc.log) to see if you can tell when it was changed?
logaraman
Regular Advisor

Re: Permission on /tmp

Hi Steve,

The permission changes even if I dont reboot or even log out from a telnet session

It changes after a few minutes.
Stephen Keane
Honored Contributor

Re: Permission on /tmp

So if you create a file in /tmp

say

# touch /tmp/fred
# chmod 777 /tmp/fred
# ll /tmp/fred

you get 777, but wait a few minutes, do

# ll /tmp/fred

again and suddenly its 677?
logaraman
Regular Advisor

Re: Permission on /tmp

steve,

You are right
Doug Burton
Respected Contributor

Re: Permission on /tmp

Try setting the /tmp dir to this:
drwxrwxrwt 8 root root 8192 Sep 14 18:05 tmp

Note thet "t". Do this to get the result:
chmod +t /tmp

Then see if the perms change.
Giri Sekar.
Trusted Contributor

Re: Permission on /tmp

Hi:

Please check or post your /etc/checklist file. It might be an issue with nosuid.

Thanks

Giri Sekar.
"USL" Unix as Second Language
Patrick Wallek
Honored Contributor

Re: Permission on /tmp

I would check for any cron jobs, at jobs, or anything else that may be running and doing a chmod.

The change in permissions like that does not happen by itself. Something has to be runningn a chmod somewhere.
Geoff Wild
Honored Contributor

Re: Permission on /tmp

Actually, permission of /tmp should be 1777

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.
Fabio Ettore
Honored Contributor

Re: Permission on /tmp

Hi,

then it is an HP-UX 11.23 system....well, in this HP-UX version /tmp has to be

drwxrwxrwt root root ... /tmp

Then

chmod 1777 /tmp

and see if it changes yet.
Effectively it seems a problem due to a cron job or something wherever is changing permissions on /tmp. It seems something like daemons under /etc/inittab....as if just /tmp permissions change then a respawn operation reports them to 677....yet very strange behaviour! ...and yet unexplainable!

Please for my (and I think our) curiosity let us know how the story ends...

Thanks and regards,
Fabio
WISH? IMPROVEMENT!
Muthukumar_5
Honored Contributor

Re: Permission on /tmp

Do this scenario as,

# mkdir /tmp/log
# chown bin:bin /tmp/log
# ls -ld /tmp/log
# chmod 777 /tmp/log
# ls -ld /tmp/log
# umask

# logout and login
# ls -ld /tmp/log
# umask

Post your /etc/profile and $HOME/.profile for that user who logged.

hth.
Easy to suggest when don't know about the problem!
logaraman
Regular Advisor

Re: Permission on /tmp

Hi All ,

Thanks for all ur inputs.

I had trieds all these inputs earlier but in Vain.. there are no cronjobs running.
Stephen Keane
Honored Contributor

Re: Permission on /tmp

Have you tried

# fuser /tmp

and

# ps -ef | grep "/tmp"

To see if anything is running against /tmp

Muthukumar_5
Honored Contributor

Re: Permission on /tmp

Pls post your try and errors regarding this.

# umask
# mkdir /tmp/log
# chown bin:bin /tmp/log
# ls -ld /tmp/log
# chmod 777 /tmp/log
# ls -ld /tmp/log
# umask

# logout and login
# ls -ld /tmp/log
# umask

Post your /etc/profile and $HOME/.profile for that user who logged.

hth.
Easy to suggest when don't know about the problem!
logaraman
Regular Advisor

Re: Permission on /tmp

Hi Muthu Kumar,

I have tried the steps you had given.. The same problem.

Pls find enclosed the requested profile and the .profile
Bill Hassell
Honored Contributor

Re: Permission on /tmp

It almost sounds as if there is a .logout file that is running as you logout. Open 2 windows, set /tmp correctly, then start ll in a loop so you can watch when it changes:

while :
do
ll -d /tmp
sleep 1
done

Once you see the permissions repeating, logout from your other window. If they immediately change, there is a logout script running. As you've probably already seen, 677 is a very bad permission for /tmp and breaks many processes that need the ability to search directories (that's the x bit for directories), definitely not normal and prbably created by a well-intentioned but mis-informed root user.


Bill Hassell, sysadmin
john guardian
Super Advisor

Re: Permission on /tmp

Hi. Just curious. Is this a Trusted System? If not, consider it. If so, why not also turn on auditing. It may provide a trail as to what's happening and who/what is making the change. Just a thought.