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.

CPanel FTP users and chown "invalid user"

Discussion in 'General Discussion' started by TJP, Apr 9, 2011.

  1. TJP

    TJP Registered

    Joined:
    Apr 9, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    We're moving from an old server on Plesk 8 to a new server with CPanel (since Plesk 9 and 10 are virtually unusable). Everything seems to be going mostly ok. However when we set up folders in SSH and then configure users for them through CPanel (let's say one of the folders is /home/mainuser/data/collection/ftpuser/), we discover that the folder is still set to root and can't be FTP'd to (though connecting works just fine). And when I try to chown -R ftpuser ftpuser to fix that, it says that ftpuser is "invalid user".

    Things I've tried so far:
    ---------------------------------
    Using ftpuser@mydomain.com instead of ftpuser (we have a static IP for this particular domain, but just in case)
    Looking in /etc/passwd to see if the user was listed there (it wasn't)
    Rebooting the FTP server (Pure-FTPD)
    Rebooting the SSH server
    Rebooting the entire server

    The core problem seems to be that the users configured through CPanel are not showing up in the /etc/passwd list. Why?
     
  2. TJP

    TJP Registered

    Joined:
    Apr 9, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    I forgot that I could just chmod to 777 and have it work regardless of user. I tried doing that, and noticed that when I put in a file, the file got set to the user for that particular domain (mainuser) rather than the FTP user (ftpuser). So I tried creating a new test folder (/home/mainuser/data/collection/ftpuser2/) and setting the owner to the domain user (chown -R mainuser ftpuser2), then setting up an FTP user (ftpuser2) for that folder through CPanel. It worked, so as far as I can tell. I can log in with the FTP user and put in files, and I don't have to chmod to 777. As to why CPanel doesn't create the folder itself, I don't know. Does the folder specified have to be in an area owned by the domain user (mainuser), or is that process run by root and something is going wrong, or what?
     
  3. 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
    For addon or subdomains, you can use the addon or subdomain name to log into FTP for that addon or subdomain, but all files on a user's account must be owned by the cPanel main user.

    For FTP accounts that aren't tied to an existing domain, you can create additional FTP users in cPanel > FTP Accounts area. When trying to connect to FTP as that FTP account user, you'd use ftpusername@domain.com where domain.com is the main domain name. When you configure the FTP user account in cPanel > FTP Accounts area, you can specify the folder that it will use. It should create the folder if it doesn't already exist at the path /home/username/public_html/ftpusername or whatever you want the folder to be called.
     
Loading...

Share This Page