Find the answer to your Linux question:
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2007
    Posts
    2

    Unhappy 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.

  2. #2
    Linux Enthusiast
    Join Date
    Jul 2005
    Location
    Maryland
    Posts
    522
    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":

    Code:
    su - root
    cd /media
    mkdir common
    and make that directory owned by group "users":

    Code:
    chgrp users common
    then, give rwx (read, write, and execute} permissions on that directory to it's group of users:

    Code:
    chmod 775 common
    now, add each trusted user to the group "users":

    Code:
    adduser user1 users
    adduser user2 users
    adduser user3 users
    Finally, log in as each user and test it by going to that directory and creating some files:

    Code:
    su - user1
    cd /media/common
    touch file_from_user1
    ls -l
    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:
    -rw-r--r--
    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.

    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:
    Code:
    chmod g+w file_from_user1
    will give the group of trusted users "write" permission to the file. And:
    Code:
    chmod g+x file_from_user1
    will give the group of trusted users "execute" permission to that file.
    You can also change permissions this way:
    Code:
    chmod 774 file_from_user1
    which will give "rwx" to the owner and the group, and r-- permission to "others".

    Hope this helps.

    Good luck, and don't give too many permissions to "others"!

  3. #3
    Just Joined!
    Join Date
    Aug 2007
    Posts
    2

    Angry 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?

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Enthusiast
    Join Date
    Jul 2005
    Location
    Maryland
    Posts
    522
    Quote Originally Posted by rboleyn View Post
    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?
    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

  6. #5
    Just Joined!
    Join Date
    Feb 2008
    Posts
    4

    Thumbs up 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:
    kashifassword:1001:513:Student Account:/home/kashif:/bin/bash
    Asimassword: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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •