Results 1 to 5 of 5
I have installed Mandriva 2007 on our home computer and set everything up. All is fine but I still have one major setback. I have 3 people who share the ...
- 09-28-2007 #1Just Joined!
- Join Date
- Aug 2007
- Posts
- 2
Multiple users on one machine
I have installed Mandriva 2007 on our home computer and set everything up. All is fine but I still have one major setback. I have 3 people who share the system. Each one has their own home and login. I want to allow each to also share a common folder to avoid duplication of files such as photos and music. Is this possible and how? Thanks all.
- 09-28-2007 #2Linux Enthusiast
- Join Date
- Jul 2005
- Location
- Maryland
- Posts
- 520
Sure it's possible. You can create directory which would be shared
by a group of users. Those users, however, will have full control (change permissions) over the files they create and own, but not someone else's files.
For example:
As "root", create a directory in /media and call it "common":
and make that directory owned by group "users":Code:su - root cd /media mkdir common
then, give rwx (read, write, and execute} permissions on that directory to it's group of users:Code:chgrp users common
now, add each trusted user to the group "users":Code:chmod 775 common
Finally, log in as each user and test it by going to that directory and creating some files:Code:adduser user1 users adduser user2 users adduser user3 users
as you can see, that file is owned by "user1" and is created with following permissions (if user1's umask is set to 0022, which should be by deafult):Code:su - user1 cd /media/common touch file_from_user1 ls -l
It means, that "user1" has rw- (read write, but not execute permissions), and "group" and "others" users only have r-- (read, no write, and no execute) permissions. Those permissions will be set the same way for files created by other users and will be owned by those users.Code:-rw-r--r--
Now, you may say: " ... but other users cannot modify or execute my files". Well, the answer to it is this:
If I create a file, by default, I do not want anybody to mess with it until I say so (I am the owner !
).
So, you give other people certain permissions to your files later. For example:
will give the group of trusted users "write" permission to the file. And:Code:chmod g+w file_from_user1
will give the group of trusted users "execute" permission to that file.Code:chmod g+x file_from_user1
You can also change permissions this way:
which will give "rwx" to the owner and the group, and r-- permission to "others".Code:chmod 774 file_from_user1
Hope this helps.
Good luck, and don't give too many permissions to "others"!
- 09-29-2007 #3Just Joined!
- Join Date
- Aug 2007
- Posts
- 2
Ok I did this but.....
I have set up the directory, moved all of the files in and was able to access but every time I log out and log in or run system update it resets user to Root, groups to admin and permissions to default???? Any ideas?
- 09-30-2007 #4Linux Enthusiast
- Join Date
- Jul 2005
- Location
- Maryland
- Posts
- 520
This shouldn't happen. Permissions and ownership of the files should remain the same no matter who you log in as. I'm thinking that this may be some nasty bug or stupid feature in the OS, or files are on an external USB drive. I've never used Mandriva myself, so maybe someone else on the forums who uses Mandriva knows about it and will reply
- 05-20-2009 #5Just Joined!
- Join Date
- Feb 2008
- Posts
- 4
Multiple users on Linux(Mandriva, FC's, etc.)
This command is intended to be used in a large system environment where many accounts are needed. Since username and passwords are stored in clear text format make sure only root can read/write the file. Use chmod command:
# touch /root/user-add.txt
# chmod 0600 /root/batch-user-add.txt
Create a user list as follows. Open file:
# vi /root/batch-user-add.txt
Append username and password:
kashif
assword:1001:513:Student Account:/home/kashif:/bin/bash
Asim
assword:1002:513:Employee:/home/Asim:/bin/bash
Now create users in batch:
# newusers /root/user-add.txt
Read man page of newusers for more information.




