Vsftpd und Zugriff auf USB-Platte (Raspberry 4b 4GB)

Hallo,

derzeitiger Stand: ich kann mit dem Win-Explorer auf den Raspi zugreifen. Die USB-Platte mit Bezeichnung “NAS” wird auch angezeigt, aber ich habe keine Berechtigung weder mit dietpi, root oder meinem Benutzernamen.
Da ich zu diesem Bereich nur über Halbwissen verfüge, bitte ich um Erläuterung wie ich das im Terminal auf die Reihe bekomme.

Danke

Hello, @Carl52

Is it a mapping of the USB disk or a share with SAMBA? If it is a mapping, it could be a question of rights in Windows:
Can’t access shared folders from File Explorer - Windows Client | Microsoft Learn

First of all, pls try to stick to English language as we are an international community. Feel free to use translation tools like DeepL.

Back to your issue. Do you use SMB to connect? Did you installed samba server on DietPi? Or you are using FTP? Which FTP client? Some more details on your system would be helpful.

I think he uses vsftpd, like said in the title? :sweat_smile:

Did you tried to change the target directory like it is mentioned in the docs?
https://dietpi.com/docs/software/file_servers/#vsftpd

ok let’s check the configuration. My guess, it’s a file system permission issue on the attached hdd

cat /etc/vsftpd.conf
lsblk -o name,fstype,label,size,ro,type,mountpoint,partuuid,uuid

can i upload the vsftpd.conf here?
I have experimented with this file so much that I have installed vsftpd again.
The settings must be correct, otherwise I could not get access to the Raspberry via vsftpd in Explorer. The explorer shows …/mnt/NAS/. Then I get the message that I do not have access permission to the folder (error 550). So I’ve already got that far. :slight_smile:

You can simply execute the commands Joulinar posted and post the output here as text.

1 Like

Since I only have half knowledge, please formulate the commands in such a way that I can also execute them in the terminal.
Many thanks

Just copy and paste this.

lsblk -o name
NAME
sda
├─sda1
└─sda2
sdb
└─sdb1
cat /etc/vsftpd.conf
userlist_deny=YES
local_root=/mnt/dietpi_userdata
listen=YES
listen_ipv6=NO
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=002
anon_upload_enable=NO
anon_mkdir_write_enable=NO
dirmessage_enable=YES
use_localtime=YES
connect_from_port_20=YES
chown_uploads=NO
#chown_username=whoever
xferlog_enable=NO
xferlog_file=/var/log/vsftpd.log
xferlog_std_format=YES
idle_session_timeout=60
data_connection_timeout=30
#nopriv_user=ftpsecure
async_abor_enable=NO
ascii_upload_enable=NO
ascii_download_enable=NO
ftpd_banner=DietPi FTP
#banned_email_file=/etc/vsftpd.banned_emails
chroot_local_user=NO
chroot_list_enable=NO
#chroot_list_file=/etc/vsftpd.chroot_list
ls_recurse_enable=YES
secure_chroot_dir=/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/private/vsftpd.pem

Can you please run the full command:
lsblk -o name,fstype,label,size,ro,type,mountpoint,partuuid,uuid

don’t you sleep at all?

NAME FSTYPE LABEL   SIZE RO TYPE MOUNTPOINT PARTUUID                             UUID
sda                14,5G  0 disk
├─sda1
│    vfat           128M  0 part /boot      8686a04b-01                          46F7-F1BE
└─sda2
     ext4           4,9G  0 part /          8686a04b-02                          76c5dad0-d004-43f1-bf12-078510b31606
sdb               931,5G  0 disk
└─sdb1
     ext4   NAS   931,5G  0 part /mnt/NAS   395b6349-86ad-4298-b681-25aa3a3ed206 4a391a71-f662-4b27-ab4d-d96dcc046044

No :crazy_face:

First of all you need to change the local_root=/mnt/dietpi_userdata in your /etc/vsftpd.conf to local_root=/mnt/NAS, if you (only) want to access the NAS and not any other files from your Pi.
But I assume also then you will be only able to read files, and not be able to write. We can change that, but first let’s check the permissions with:

ls -la /mnt/NAS
1 Like

Good morning,

something is still missing

with ls -la /mnt/NAS the folders are displayed

I am only allowed to upload one file

It’s quite simple. Pls execute the command on our DietPi system and share the output.

is that enough?
I did not want to show all folders
ftp_3

you could copy/past whole output and mask/remove folder names.

BTW: current FTP server configurtion is pointing to folder /mnt/dietpi_userdata and not to /mnt/NAS

thank you, now it works

Would it be possible to share what has been changed?

I had a thinking error,
after I had entered /mnt/NAS in vsftpd.conf I searched for the folders under
ftp://192.168.x.x/mnt/NAS/. But correct is ftp://192.168.x.x/

Thanks for your help. :smiling_face_with_three_hearts:

maybe it is useful to add your own user name

adduser {benutzername} --shell /bin/false/