Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

read-only ftp user

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

  1. dandadude

    dandadude Active Member

    Joined:
    Apr 14, 2011
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    56
    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,609
    Likes Received:
    32
    Trophy Points:
    238
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. dandadude

    dandadude Active Member

    Joined:
    Apr 14, 2011
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    56
    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:
    11
    Trophy Points:
    168
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    Doesn't it also work if you just:

    chown nobody:nobody /home/username/ftpdir
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. NixTree

    NixTree Well-Known Member

    Joined:
    Aug 19, 2010
    Messages:
    405
    Likes Received:
    3
    Trophy Points:
    143
    Location:
    Gods Own Country
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. dandadude

    dandadude Active Member

    Joined:
    Apr 14, 2011
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    56
    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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice