[TriLUG] SCP file create mode
Brian A. Henning
lugmail at cheetah.dynip.com
Wed Feb 18 16:20:01 EST 2004
Okay.. I forgot to mention that my friend is using a Windows client. So I
don't think the preserving permissions will work, since Windows uses a
different permissions set? Anyhow, I think umask is the way to go. So that
brings me to a new curiosity.
Is there some mechanism that affects whether /etc/bashrc is executed for a
user? The reason I ask is, if I login with my username, my prompt looks
like
[username at host pwd]#
and my umask is 002 (rwxrwxr-x)
The root prompt looks similar, with umask 022 (rwxr-xr-x). However, logging
in with his username results in a prompt that looks like:
bash-2.05a$
with a umask of 022 (rwxr-xr-x).
I've looked at /etc/bashrc and cannot understand why his user is getting
umasked to 022, and mine to 002. The section of /etc/bashrc that controls
umask is
if [ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]; then
umask 002
else
umask 022
fi
..which I interpret to mean "If the user's primary group name is the same as
the username, and if the user's numeric ID is greater than 99, set the umask
to 002. Otherwise, set it to 022."
When I create a shell script that simply consists of the above snippet, it
evaluates correctly, further leading me to believe that /etc/bashrc simply
isn't being executed for this particular user.
I've looked through a number of manpages, including umask, bash, usermod, to
no avail.. What am I missing?
~Brian
More information about the TriLUG
mailing list