On Sun, 2002-04-07 at 16:50, Klaus Ade Johnstad wrote:
> I have 60-70 users on my system, all have been added with the useradd -m
> command, which I realize now made them belong to the same group 'users',
> had I used the command adduser instead then they would have ended up
> belongig to individual groups, which is what I need...
> 
> My problem commes from the fact that the users want to have a dirctory
> that they all can read/write in, this I can achieve if I make them all
> belong to individual groups, and then make this group a member of another
> group that actually owns this shared directory, and then change the umask
> to 002 of every user, and possibly put a 3770 on this shared dierectory.

If they are all in group users, why not just chown a directory to group
users and set the groups read, write and execute bits?

mkdir /var/sharedspace
chgroup users /var/sharedspace
chmod g+rwx /var/sharedspace

> I can to all of this by hand, but I wonder if anyone possibly knows of a
> script that could help me out a bit, otherwise I'll have to use the whole
> night.

Change the umasks of every user? How about changing /etc/profile?

Don't spend all night doing it. Such scripts are normally very simple.
If you post a very specific question to the list, I'm sure we can write
a script to the list. For example.

Every user on the system is in the /home directory. In all their home
directories is a file .bashrc and in that file is a line umask 022. I
want to change every occurance of that line in those files to read umask
002. How to I do that easily with a script?

For which the answer is

for dir in /home/*; do cat $dir/.bashrc | sed -e 's/umask 022/umask
002/g' > /tmp/user.temp; cp /tmp/user.temp $dir/.bashrc; done

Crispin Wellington


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to