How to create a new FTP-user in a domain
Submitted by Altzgamer on Thu, 06/04/2009 - 14:48
Hi,
1. I created a domain, let's say "domain.com".
2. I have FTP-user "domain"
3. I want to add a new FTP-user, who would have access to "vhosts/domain.com/httpdocs/" directory
4. In a control panel I'm adding an FTP-user, but i can't point that this particular FTP-user can have access to the needed directory.
5. I tried to change it in the ehcp-Mysql database but it still can't point me to the needed directory.
How can I change that?
Forums:
ehcpdeveloper
Thu, 06/04/2009 - 21:10
Permalink
as of ver 0.29.09 there is no
as of ver 0.29.09 there is no autmatic , gui way of doing this.
You may do it by :
1- insert a new row into ftpaccounts table, setting homedir field.
set it to whatever you want in ehcp db, ftpaccounts table,
2- then go to ehcp gui, add a new arbitrary ftp user, then delete it (this synchronizes ehcp db to system, since the ftp user has non standard home dir)
(i will make this automatic or more easy in future ehcp versions..)
it should work, i may help you further if you need.
this is also discussed in http://www.ehcp.net/?q=node/120
Any directory you defined there should be accessible by vsftpd user of system, to do that,
chown vsftpd yourdir
in your console
Altzgamer
Fri, 06/05/2009 - 01:12
Permalink
Thank you for your help. 1.
Thank you for your help.
1. I did as you said. I created a user. Domainname: domain.com. I'm not sure what to write in the homedir. Should it be the absolute path like /var/www/vhosts/domain.com/httpdocs/ ? or just /httpdocs/ ?
2. I tried those 2 options and I tried leaving it blank as well. Whatever I do, Filezilla tells me:
500 OOPS: cannot change directory:httpdocs
500 OOPS: child died
(even if it's blank).
ehcpdeveloper
Fri, 06/05/2009 - 11:31
Permalink
Write absolute path there:
Write absolute path there: /var/www/vhosts/domain.com/httpdocs/
then,
did you do the 2nd step ? (then go to ehcp gui, add a new arbitrary ftp user, then delete it)
it is necessarry to do that as of version 0.29.09 (i will improve that in future)
alternatively, after doing all, (before trying in filezilla) try in console:
mkdir /var/www/vhosts/domain.com/httpdocs/
chown vsftpd /var/www/vhosts/domain.com/httpdocs/
And let me know at which stat it worked or not worked..
Note that, you try to do an un-supported feature of current ehcp version. So, these are some manual operations, in fact conflicts with "easy" philosophy of ehcp. Thats why you deal a bit...
See you.
Altzgamer
Fri, 07/03/2009 - 21:05
Permalink
Thank you!!! Your advice
Thank you!!! Your advice worked perfectly. Everything is fine now! See you!
ehcpdeveloper
Fri, 07/03/2009 - 21:43
Permalink
newer version of ehcp,
newer version of ehcp, 0.29.10, is coming and will have most of these things automatic.
djanym
Sat, 01/16/2010 - 07:07
Permalink
I have the same thing.... and
I have the same thing.... and it's very strange, because it was working, but for now it's throwing me error "500 OOPS: cannot change directory" for any new created ftp account.
I was trying step 1 and 2.. and no success...
Also I have other permissions errors... for example can't create custom http... In logs i see some permissions error... Can you help me with it?
ehcpdeveloper
Sat, 01/16/2010 - 19:54
Permalink
please make apply debug
please make apply debug techniques described in http://ehcp.net/?q=node/771
and make sure that your ehcp daemon running.
while debugging, ehcp gui->options->sync domains
look in logs in debug windows (consoles)
djanym
Sat, 01/16/2010 - 22:56
Permalink
This is what I have: This is
This is what I have:
This is what I have:
ehcp 0.29.12- Daemon loop number:18468
-----------daemon suspended for 10 sec ---------pwd:(/var/www/vhosts/ehcp)
Array
(
[0] => Array
(
[id] => 155
[host] =>
[op] => daemonftp
[status] =>
[tarih] => 0000-00-00 00:00:00
[try] => 0
[info] => /var/www/vhosts/localuser/q
[info2] =>
[action] => add
)
)
(runop2) op:daemonftp, action:add, info:/var/www/vhosts/localuser/q, info2:
executing command: mkdir -p /var/www/vhosts/localuser/q
(escapedcmd: mkdir -p /var/www/vhosts/localuser/q)
mkdir: cannot create directory `/var/www/vhosts/localuser/q': Permission denied
executing command: chown vsftpd:www-data -Rf /var/www/vhosts/localuser/q
(escapedcmd: chown vsftpd:www-data -Rf /var/www/vhosts/localuser/q)
I'm trying to create an ftp user... I have many such errors... Any suggestion?
ehcpdeveloper
Sat, 01/16/2010 - 23:02
Permalink
those logs shows what your
those logs shows what your errors are, and obviously, your ehcp daemon(background process that does almost everything) has not enaugh permissions. to fix, try:
djanym
Sat, 01/16/2010 - 23:15
Permalink
Great! After restarting ehcp
Great! After restarting ehcp it is working fine now. Djazaka-Llahu hair, kardeşim. ;)
djanym
Sat, 01/16/2010 - 23:08
Permalink
Also: Update disk quota:
Also:
Update disk quota: mydom.com:1 | /var/www/vhosts/mydom/mydom.comdu: cannot read directory `/var/www/vhosts/localuser/mydom2.com/httpdocs/subdomains/subdom/sites/default/files/civicrm/templates_c/en_US/en_US/%%64': Permission denied
du: cannot read directory `/var/www/vhosts/localuser/mydom2.com/httpdocs/subdomains/subdom/sites/default/files/civicrm/templates_c/en_US/en_US/%%F0': Permission denied
du: cannot read directory `/var/www/vhosts/localuser/mydom2.com/httpdocs/subdomains/subdom/sites/default/files/civicrm/templates_c/en_US/en_US/%%11': Permission denied