Hey champs!
I need some help.
I got an ubuntu 18.04 dedicated server I run and manage as a seedbox. downloading torrents, streaming media for family & friends and so on.
I usually just let friends use my own pass to log to my server via fileZilla to download files using ftp..
I want to have more control on what's going on and looking forward to do the following:
1. Create a user that has the ability to connect to the server with ftp
2. User to be able ONLY to download files, not delete or move
3. User to be able to view only certain folders
I've tried following several guides but honestly nothing was exactly as my system or packages and some commands were simply missing or not working.
I have access to root user & a regular user I use for ftp and other stuff.
Would love to get some guidance or help with the stuff I listed!
Thanks in advance.
Good deeds make a long distance.
have you tried that ?
https://linuxmining.com/create-ftp-user-on-ubuntu/
+
https://www.eukhost.com/blog/webhosting/...directory/
otherwise i recommend you a simple web control panel like virtualmin that allow you to manage everything such this kind of thing via browser easly and quickly
quote my answer or i may miss yours!
(Apr 1, 2023 11:48 AM)Yani Wrote: If your friends and family only stream media, I suggest setting up a Plex server instead.
Will be much easier and userfriendly for them.
They do! I set up the Plex and they watch it via plex.
I am talking about transferring big albums or games I get for them.
Good deeds make a long distance.
(Apr 2, 2023 01:06 AM)phantomman55 Wrote: what kind of games man? Why not share your collection with us buddy?
can't you just add a system user? DoeS THE FTP uses the system users?
That's how I kind of solved it in the end.
Created a system user, added him to my own account group so he can access "my" home directory.
Then, he has read-only permissions so he cant remove or move files, only download.
And I changed his 'starting dir' to be mine.
Also, he is logging in with SFTP since for some reason FTP does not work for me for new accounts idk why
Good deeds make a long distance.
Apr 4, 2023 05:19 AM
(This post was last modified: Apr 4, 2023 05:27 AM by Betty Blue.)
(Apr 2, 2023 10:24 PM)MightyOne Wrote: That's how I kind of solved it in the end.
Created a system user, added him to my own account group so he can access "my" home directory.
Then, he has read-only permissions so he cant remove or move files, only download.
And I changed his 'starting dir' to be mine.
Also, he is logging in with SFTP since for some reason FTP does not work for me for new accounts idk why Instead of adding to your user group, you should add him to the ftp group, and then give ftp group access to the directory that you would be using for storage.
And typically you’ll not want that folder to be in your home directory, you’ll have to create a new group for the ftp access, fro users or something.
Also, are you using sftp? ftp isn’t secure.
XMPP: pm me
To restrict the user to be able ONLY to download files, not delete or move, you can use vsftpd. You can install it using the following command:
sudo apt-get install vsftpd
Then you can edit the configuration file /etc/vsftpd.conf and add the following lines at the end of the file:
userlist_enable=YES
userlist_file=/etc/vsftpd.userlist
userlist_deny=NO
anon_world_readable_only=YES
anon_upload_enable=NO
anon_mkdir_write_enable=NO
anon_other_write_enable=NO
local_root=/home/username/ftp
chroot_local_user=YES
allow_writeable_chroot=YES
Replace username with your desired username.
To allow the user to view only certain folders, you can create a new directory and give it appropriate permissions. Then you can mount that directory to the user's home directory. Here is an example:
sudo mkdir /var/ftp/files
sudo chown nobody:nogroup /var/ftp/files
sudo chmod a-w /var/ftp/files
sudo mount --bind /var/ftp/files /home/username/ftp/files
Again, replace username with your desired username.
I hope this helps! Let me know if you have any other questions.
|