The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

read-only ftp user

Discussion in 'General Discussion' started by dandadude, Dec 12, 2011.

  1. dandadude

    dandadude Active Member

    Joined:
    Apr 14, 2011
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    Hi!

    One of my clients wants me to make him 2 users for a certain directory in his account, but one of them should have read-write access, while the other one should only have read-only access.

    Is this possible in an elegant way?
    If yes, how?
    If no, what is the best non elegant way to do this?

    I was thinking of syncing a dir every 5 minutes to another dir where I give root:root write access, thus the normal user account can only read, but this is not a nice solution.
    The other thing could be somekind of symlink or hardlinking, but I would need some advice on how to do it the best way if at all possible.

    Thank you in advance!

    Regards,
    Daniel
     
    #1 dandadude, Dec 12, 2011
    Last edited: Dec 12, 2011
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
  3. dandadude

    dandadude Active Member

    Joined:
    Apr 14, 2011
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    Hi Tristan!

    Thanks for the help, but I needed an account that has user/pass authentication and read-only privileges, and anonymous user is without authentication.

    So I started to test what would happen if I place a symlink to another user account. This method worked, so let me explain:

    - We have userA and userB.
    - I create a /home/userA/ftp1 directory, "chown userA:userA /home/userA/ftp1"
    - I create a /home/userB/ftp1 directory, "chown userB:userB /home/userB/ftp1"
    - I create a ftp1@userA_domain FTP account for userA, which points to /home/userA/ftp1.
    - I create a ftp1@userB_domain FTP account for userB, which points to /home/userB/ftp1.
    - I delete /home/userB/ftp1 and give the command "cd /home/userB/; ln -s /home/userA/ftp1"

    After the above:
    ftp1@userA_domain has read/write access to /home/userA/ftp1 directory.
    ftp1@userB_domain has read-only access to /home/userA/ftp1 directory.

    So this works, hurray! :)

    Bye,
    Daniel
     
  4. quietFinn

    quietFinn Well-Known Member

    Joined:
    Feb 4, 2006
    Messages:
    998
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    Doesn't it also work if you just:

    chown nobody:nobody /home/username/ftpdir
     
  5. NixTree

    NixTree Well-Known Member

    Joined:
    Aug 19, 2010
    Messages:
    386
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Gods Own Country
    cPanel Access Level:
    Root Administrator
  6. dandadude

    dandadude Active Member

    Joined:
    Apr 14, 2011
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    Hi All!

    1. "chown nobody:nobody" is not an option, because then the readwrite user will not be able to write in it either.

    2. ProFTPD would sound nice, but I prefer pure-ftpd. But that might be a good idea in the future. Thx.

    Bye,
    Daniel
     
Loading...

Share This Page