Find the answer to your Linux question:
Results 1 to 5 of 5
I have a server running SLES 10.1 and using pure-ftpd. I need users to have access to specific folders. When the user connects via FTP to the server, they are ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2009
    Location
    Illinois
    Posts
    9

    Folder Permissions for Two Users


    I have a server running SLES 10.1 and using pure-ftpd. I need users to have access to specific folders. When the user connects via FTP to the server, they are placed in their specific folder. Below is the folder layout:

    All user directories are located under one folder (Main)

    Main

    -Andrew
    ------Andrew's Stuff
    -Thomas
    -------Thomas' Stuff

    Now, the issue I am having is that I need one user (lets call him Steve) to have access to all folders located in Main.

    So when "Steve" connects to the server he is in the main directory. (Where the "Andrew" and "Thomas" directories are located. "Steve" needs full access [rwx] to everything under "Andrew" and "Thomas'" folders. While at the same time "Andrew" and "Thomas" connect into their respected directories and need full access to theirs only.

    It seems that the way I have this setup "Steve" can only get into files he creates, or if the rights are changed "Thomas" and "Andrew" cannot.

    I was never any good at setting rights. I would just use the root account, except that I am not going to be the one updating this server, therefore I need another account that is not quite root.

    I have tried: chown Andrew:Andrew to the Andrew folder and then added Steve to the Andrew group, however this did not work.

    Any suggestions? Much thanks!

  2. #2
    Linux User Krendoshazin's Avatar
    Join Date
    Feb 2005
    Location
    London, England
    Posts
    471
    When you add Steve to the group Andrew you will need to logout and log Steve back in, this will allow the new changes to take effect. Don't forget to create a group for each user and make sure that the user directories are set to permission 775.

  3. #3
    Just Joined!
    Join Date
    May 2009
    Location
    Illinois
    Posts
    9
    Is there a way to allow any folder created by either user, Andrew or Steve, to be viewable by the other by default? It seems as if Steve creates a folder Andrew can't view, and vice versa. Seeing as this is for an ftp, this is not good.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux User Krendoshazin's Avatar
    Join Date
    Feb 2005
    Location
    London, England
    Posts
    471
    Yes there is. You'll want to to modify their ~/.bash_profile and ~/.bashrc files to include the line:
    Code:
    umask 007
    , this will set the default permissions to 660 for files and 770 for folders. That means that the owner and group will have full read-write-execute permissions but anyone else will have none. If they use a different shell you can modify the config file - ~/.zshrc for example - the same way.
    If you would like to set these as a global mask I believe you can do that in /etc/login.defs, search for UMASK and change the value from 022 to 007.

  6. #5
    Just Joined!
    Join Date
    May 2009
    Location
    Illinois
    Posts
    9
    Thank you so much. You have been extremely helpful!

Posting Permissions

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