I have SSH access in CentOS server. I have also Plesk 9.2
I want to create a new folder e.g. mytest into my httpdocs and then to add a new FTP user in order to have access only to this folder, I want to see only this directory and not any other.
Assuming you have root access the procedure can be summarised as follows, where 'pathto' throughout the instructions is the full path ( /something/something/httpdocs/mytest ) and 'myuser' will be the user:
So first we assume that mytest as a directory already exists and that myuser will be the user and group name. As root we run:
addgroup myuser
adduser --home pathto --no-create-home --group myuser myuser
Then enter a password when prompted.
Now we edit /etc/proftpd/proftpd.conf, you may wish to backup the file first. With your favourite editor ensure that the following is set in the config file:
DefaultRoot ~
this locks logged in users down to their home directories (ymmv, this can have consequences for obvious reasons).
Now we should ensure that the permissions are correct for our new user...
chown myuser:myuser pathto
chmod 755 pathto
755 will give the directory user read/write/execute, user and world read/execute (necessary for apache to see the files therein, give or take).
Now we can restart proftpd and test our changes:
/etc/init.d/proftpd restart
Some things to note about these instructions:
If you need changes to this shout and i'll make them, I just wanted to get something written up, even if slightly wrong.
ftp localhost
When logged into the server via SSH and see what response it gives. It should tell you via a welcome message. I think it uses VsFTPD but I'm not familiar with it and would like to be sure before I write some instructions. Though any instructions I provide would be command line and assume familiarity with vi or some other editor, e.g. not configuration via plesk.ftp localhost
but it gives me an error "ftp: command not found". I am using CentOS.ls -l /etc
(don't copy and paste the output here) do you see either of: proftpd / vsftpd as directories. If you have one of those that is more than likely the FTP daemon you are running. The other choice is to connect via FTP remotely using whatever software you use and look at the banner. Most windows FTP clients display it in one window or another.