SA-MP Forums Archive
Centos HELP - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Other (https://sampforum.blast.hk/forumdisplay.php?fid=7)
+--- Forum: Everything and Nothing (https://sampforum.blast.hk/forumdisplay.php?fid=23)
+--- Thread: Centos HELP (/showthread.php?tid=452231)



Centos HELP - SsHady - 20.07.2013

hello everyone i;m trying to create another ftp account so it have only access to /var/www/html/ folder
but i can't figure on how to do that?
can anyone help me


Re: Centos HELP - NewerthRoleplay - 20.07.2013

Well really you have two options, you could change your default apache directory to a new users home area (/home/username) and when they connect via ftp it would put them into that directory.

You can use this site to install VSFTPD which is a FTP server for UNIX systems. Ignore the steps regarding installing the FTP client on your remote machine, since you would probably be doing that from a client such as FileZilla.

Or on the other hand, you could use webmin to manage your CentOS server, and through this online panel you can choose to add extra apache zones, and add new users to change their home directory.

Feel free to PM me if you'd like anymore help!


Re: Centos HELP - SsHady - 20.07.2013

you know i've created an user account
and whenever i open FTP on filezilla via that new account
it opens the /home directory
i want it to open /var/www/html directory and only that directory
so that user can't go back and mess with other files.


Re: Centos HELP - NewerthRoleplay - 21.07.2013

Use this command,
Код:
usermod -m -d /var/www/html YOURUSERNAME
just use that via SSH and it should take effect.

-Connor


Re: Centos HELP - SchurmanCQC - 22.07.2013

Do the following:

Код:
# useradd -d /var/www/html ftp-uname-here
A user should be created. Then do this:

Код:
# passwd ftp-uname-here
And set the password for the user.

Then make sure you do this, or the directory will not be writable for the user:

Код:
# chown -R ftp-uname-here /var/www/html
Make sure to replace ftp-uname-here with the username you want to use FTP with.

When this is done, log into FTP using the username and password of the user you just created!

Good luck.

EDIT: I thought I'd add an example...

Код:
# useradd -d /var/www/html webftp
# passwd webftp
New password: fluffs
# chown -R webftp /var/www/html

#