PDA

View Full Version : Make new user with access to 1 folder



Ni3ls
1st October 2014, 11:08
Hi all,

How do I create a new user on my vps that can only access only 1 folder and the subfolders? He must be able to edit stuff, upload and download in that folder. folder is inside root/cod2 and then foldername "cry".

YuriJurek
1st October 2014, 12:21
You need to install some sort of ftp server, try http://www.proftpd.org/ I think it's the best out there for your purpose, also there are lots of tutorials on how to set-up it properly and grant access for one user to certain directory. Let me know if you need any further help.

Depending on your distro here are a few examples of installation:
https://www.digitalocean.com/community/tutorials/how-to-set-up-proftpd-on-ubuntu-12-04
https://www.digitalocean.com/community/tutorials/how-to-set-up-proftpd-on-centos-6
https://www.debian-administration.org/article/228/Setting_up_an_FTP_server_on_Debian

Mitch
1st October 2014, 13:04
I use Pure-FTPd and it supports virtual users with only access to their directory.

http://articlebin.michaelmilette.com/setting-up-pure-ftpd-in-ubuntu/

Ni3ls
1st October 2014, 13:24
Well I still got problems. I dont understand it very good :/ I already got a user called "cry" and the directories root/cod2 contains all the COD2 files that are needed. "cry" would be the fs_game. Even when I do
usermod -d /root/cod2/cry cry he can login with sftp, but vps opens in the main screen and not that specific folder

kung foo man
1st October 2014, 14:19
Just remove the read/write flags, but not the access/x flag from the directories:



chmod 711 /
chmod 711 /home
chmod 711 /lib32

chmod 700 /root -R


(Possible in WinSCP also ofc)

I don't know why you put the "home" folders into /root. Normally all users belong into /home.

Ni3ls
1st October 2014, 17:10
I dont get it. They are talking about home/user. But I already got a directory. They need access to that one and only directory and not able to go to higher directories.