General
cancel
Showing results for 
Search instead for 
Did you mean: 

remsh does not preserve the umask settings at the remote node

 
Highlighted
Honored Contributor

remsh does not preserve the umask settings at the remote node


adedd75n#remsh adedd76n -n "umask 022;ln -s /home/chakls/ff /home/chakls/pp"
adedd75n:root [/home/chakls]

adedd76n:root [/home/chakls] ll pp
lrwxr-xr-x 1 root root 15 Mar 20 08:42 pp -> /home/chakls/ff
adedd76n:root [/home/chakls]

If i dont specify the umask then the link files are getting created by 777 even though the umask values are 022 on both local and REMOTE servers.

This was not happening earlier. Just noticed and dont know of any changes.

any one seen this befor?

7 REPLIES 7
Highlighted
Honored Contributor

Re: remsh does not preserve the umask settings at the remote node

if you execute remsh with your system name and umask, you get the DEFAULT for the system type (in /etc/profile) you have regardless of the umask that you set when files are created. This is a security measure built into the OS On "trusted" systems, the default umask for remote access is 066.
On an non-trusted system, the default umask is 000.
Highlighted
Honored Contributor

Re: remsh does not preserve the umask settings at the remote node


if you execute remsh with your system name and umask, you get the DEFAULT for the system type (in /etc/profile) you have regardless of the umask that you set when files are created. This is a security measure built into the OS On "trusted" systems, the default umask for remote access is 066.
On an non-trusted system, the default umask is 000.

#grep -i umask /etc/profile
umask 0022

all are trusted systems.

All soft links (ln -s) getting created with 777 if umask is not passed explicitly as mentioned above
Highlighted
Honored Contributor

Re: remsh does not preserve the umask settings at the remote node

Sorry didn't notice you were creating links.
Links are a little different.

Have you looked at this thread?

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=956122

Highlighted
Honored Contributor

Re: remsh does not preserve the umask settings at the remote node

i did.
Highlighted
Acclaimed Contributor

Re: remsh does not preserve the umask settings at the remote node

>If i don't specify the umask

If you don't specify umask, you get some umask value that isn't yours. Your .profile isn't being executed and neither is /etc/profile.
Highlighted
Honored Contributor

Re: remsh does not preserve the umask settings at the remote node

as i mentioned ealier; it was working for years this way..Just a few week now it started behaving this way.
Highlighted
Acclaimed Contributor

Re: remsh does not preserve the umask settings at the remote node

>Just a few week now it started behaving this way.

Did you change any security settings?

In any case, you should only use remsh to look and not touch. Use rlogin for extensive tasks.
Or you need to bulletproof your scripts used in remsh.

Here are some links about umask and remsh:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1150173

And some external ones:
http://unix.ittoolbox.com/groups/technical-functional/unix-security-l/users-default-umask-in-itanium-64-box-1545802
http://www.unix.com/unix-advanced-expert-users/2792-issues-umask.html