Permissions of additional FTP users

Weboz

Member
Jan 28, 2013
10
0
1
cPanel Access Level
Root Administrator
Hallo, have a VPS license (WHM & Cpanel).

When creating a new FTP account through Cpanel, like "[email protected]", I can't overwrite existing files.
How can i changes the permission for this account? I want to allow this user everything in a specially folder.
(Like in folder /public_html/billing/sys).

Thanks, hope some one can help me! :)

Regards,
Christian.
 

Infopro

Well-Known Member
May 20, 2003
17,113
507
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
When you create an addon FTP account, and login using that addon account's log in details "[email protected]" for example, you should have access to overwrite and delete files in the directory you're in. Were these files that you cannot overwrite there, previous to creating this addon FTP account? Can you check the owner of those files you're unable to overwrite to see who the owner is?
 

Weboz

Member
Jan 28, 2013
10
0
1
cPanel Access Level
Root Administrator
Thanks for fast reply.

Before i created the FTP account i used the root account to upload the files. How do i change the "owner" of the files ? So my new account have all permissions.
 

Infopro

Well-Known Member
May 20, 2003
17,113
507
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
So the files are owned by root then, this is why you can't modify them logged in as an addon FTP user. You could run a command on the directory of files to change ownership if you're comfortable doing that, or you might login as root, kill the files you uploaded and then re-upload them as the cPanel account owner. Might be safer and easier depending on you.
 

Weboz

Member
Jan 28, 2013
10
0
1
cPanel Access Level
Root Administrator
So i can't change some settings in the WHM to turn this function off?
Theres alot of files that are connected to databases and cron jobs. I'm not satisfied with deleting all files and re-uploading it. May effect some of the files. What kind of commands can i run to swap owner?
 

Infopro

Well-Known Member
May 20, 2003
17,113
507
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
So i can't change some settings in the WHM to turn this function off?
No. There is no function to turn off, it's a file ownership issue. It seems.

Theres alot of files that are connected to databases and cron jobs. I'm not satisfied with deleting all files and re-uploading it. May effect some of the files.
If the files are owned by root, they are already, affected. Running commands that you're not sure of on a server can make a real mess and have an affect on the entire server.

Just ask this guy: Chown Nightmare - cPanel Forums
Or this guy: Big Problem - I accidently chmod 000 a lot of files! - cPanel Forums

What kind of commands can i run to swap owner?
One file:
chown weboz:weboz /home/weboz/public_html/pathto/file

An entire directory and all files in it:
chown -R weboz:weboz /home/weboz/public_html/pathto/directory
 

Weboz

Member
Jan 28, 2013
10
0
1
cPanel Access Level
Root Administrator
An entire directory and all files in it:
chown -R weboz:weboz /home/weboz/public_html/pathto/directory
Thanks!
Before i do the changes, could i go to:
cd /home/[account]/public_html/billetter

And then perform the command chown -r [account]:[account] ? Will all files in the dircetory i'm currently in change?

shouldn't it be root:[account]? root are the currently owner of the files.. Or should it be like you wrote it [useraccount]:[useraccount] on both side of the ":"?

Thanks you so much for your help, really appreciate it.
 

Infopro

Well-Known Member
May 20, 2003
17,113
507
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
You're certainly welcome. :)

Assuming that your server is running SuPHP, all files and directories inside should be user:user

public_html itself, should be user:nobody and nothing in this account, inside public_html directory should be owned by root.

If needed, you might create a test directory, add some random files as root user to the directory, and then change permissions on them to experiment. For example:

chown -R weboz:weboz /home/weboz/public_html/pathto/testdirectory

Keeping the full path in the command should keep you out of trouble for the most part.

GL!