[Redhat8 & VSFTPd] nieuwe ftp-user zonder adduser

Pagina: 1
Acties:

  • DPLuS
  • Registratie: April 2000
  • Niet online
Hoi,

Ik wil in VSFTP een nieuwe gebruiker maken, maar alleen voor FTP-doeleinden.
Normaal moet je dan in je shell met 'adduser' een nieuwe gebruiker maken, maar dat moet ik niet hebben omdat deze gebruiker ALLEEN MAAR hoeft te FTP'en (dus geen email ontvangen voor die user, ssh-access, enz... ).
Kan ik dit überhaupt bewerkstelligen en zoja hoe??

Ik heb al op GoT en Google gezocht en natuurlijk op http://vsftpd.beasts.org/.
Maar overal wordt er geschreven dat je gebruikers moet aanmaken met adduser.
Maar wat ik dus moet hebben is gewoon een ftp gebruiker met nul komma nul rechten.

Verwijderd

Toch is dat op GoT echt wel te vinden. Kijk maar eens naar dit draadje of naar deze zoekopdracht .

  • saviour
  • Registratie: Juli 2000
  • Niet online
Ik gebruik iets als:

useradd ftpuser -g ftp -d /dev/null -s /bin/false

Alleen gebruik ik een andere groep dan "ftp" en een andere shell (eentje waarin staat dat je niet mag inloggen en die je dan meteen disconnect.

De shell die je gebruikt moet dan wel in /etc/shells staan.

  • DPLuS
  • Registratie: April 2000
  • Niet online
Ik heb nu gevonden wat ik zocht, ik zal het voor de volledigheid hier ook posten:


This example shows how to extend the "VIRTUAL_USERS" example to reflect
a slightly more complex setup.

Let's assume that we want two types of virtual user - one that can only browse
and download content, and another that can upload new content as well as
download existing content.

To achieve this setup, we can use use of vsftpd's powerful per-user
configurability (new in v1.1.0).

In the previous virtual user example, we created two users - tom and fred.
Let's say that we want fred to have write access to upload new files whilst
tom can only download.

Step 1) Activate per-user configurability.

To activate this powerful vsftpd feature, add the following to
/etc/vsftpd.conf:
user_config_dir=/etc/vsftpd_user_conf

And, create this directory:

mkdir /etc/vsftpd_user_conf


Step 2) Give tom the ability to read all files / directories.

At the end of the last example, we noted that the virtual users can only
see world-readable files and directories. We could make the /home/ftpsite
directory world readable, and upload files with world-read permission. But
another way of doing this is giving tom the ability to download files which
are not world-readable.

For the tom user, supply a config setting override for
anon_world_readable_only:

echo "anon_world_readable_only=NO" > /etc/vsftpd_user_conf/tom

Check it out - login as tom and now "ls" will return a directory listing!
Log in as fred and it won't.
NOTE - restart vsftpd to pick up the config setting changes to
/etc/vsftpd.conf. (Advanced users can send SIGHUP to the vsftpd listener
process).


Step 3) Give fred the ability to read all files / directories and create
new ones but not interfere with existing files.

echo "anon_world_readable_only=NO" > /etc/vsftpd_user_conf/fred
echo "write_enable=YES" >> /etc/vsftpd_user_conf/fred
echo "anon_upload_enable=YES" >> /etc/vsftpd_user_conf/fred

Check it out - login as tom and you can't upload. Log in as fred and you can!
Try and delete a file as both tom and fred - you can't.