using sftp locally I got a ’ permission denied, please try again’ error, remotely with Filezilla , Authentication failed…
not sure where I missed something, as it should be straightforward.
I used /home for creating the user
BTW, using the default osmc login (I changed passwd) it works fine, with the big issue of being able browsing all folders ( of course I’d like to avoid this …
Many thanks for your reply, making progress…
by changing in /etc/passwd “/usr/sbin/nologin” to “/bin/bash” it works…but I can navigate to the whole folders contents (: , user is not jailed of course, and this is not what I want (who will?)
just to be sure, could you please share the vsftpd.conf file content?
currently I renamed it, assuming vsftpd will use default values then
I made several changes before landing here, so I may have to use either a default setup or a similar one to yours to get it working.
BTW, I’m using sFTP and not basic FTP
BTW2: ls -al on the shared folder is remaining to osmc:osmc, even if no error when using sudo chown, strange…[EDIT] this is a NTFS formatted disk, probably the issue?
I believe this should be interesting for other users to share some folders with their family (pictures & private videos) through sFTP as secure as possible, without using social networks too
Most likely the userrights is problem, since I finally solved it on my ext4 formated drive.
From googleing this issue alot, they answer was the same all the time, root must be owner of the folder and no write access to anyone else.
I tried it lots of times and didn’t get it to work, untill i looked at the mountpoint of my external disc /mnt/disc1. It was write enabled for world, which broke the “only root writeable” in chroot enviroment.
So this is how i did: sudo -s chown root:root /mnt/disc1 chmod 755 /mnt/disc1 chown root:root /mnt/disc1/kids chmod 755 /min/disc1/kids exit
chown root:root on /home/user/pictures doesn’t work, rights remain to osmc:osmc
I’ll backup my drive and format it from console using ext4, I know for accessing it from Windows I’ll have to install some utility, but as its content is visible from the network, not sure I’ll do this often…
I only used that utility mention in the other thread, once or twice when moving huge libarys of mp3 and video-files from the my sons birthings (4 boys, a whole lot of fotage).
so I now have my USB disk formatted in ex3, by Debian, rights elevated to root:root and still it’s not working.
I even created a brand new user (invite) and same result, even with exactly the same rights as the user who is linked to the folder located on the SD Card . But only this one works(olivier)
This is the only visible difference I can see.
if I change the value of
Match user
to external or invite, I can connect to one but not the other, but both alternatively are not jailed to their home directory.
to olivier, this user can be jailed
folders:
osmc@framboise:/home$ ls -al
total 16
drwxr-xr-x 4 root root 4096 Feb 1 19:33 .
drwxr-xr-x 24 root root 4096 Jan 30 08:37 …
drwxr-xr-x 2 root root 4096 Feb 1 20:54 olivier
drwxr-xr-x 9 osmc osmc 4096 Feb 2 13:18 osmc
osmc@framboise:/home$
osmc@framboise:/media/Tera II/FTP$ ls -al
total 24
drwxrwxrwx 5 root root 4096 Feb 2 11:58 .
drwxrwxrwx 8 root root 4096 Feb 2 17:01 .
drwxr-xr-x 2 invite invite 4096 Feb 2 11:12 E
drwxr-xr-x 2 invite invite 4096 Feb 2 12:34 Q
drwxr-xr-x 2 invite invite 4096 Feb 2 11:58 S
-rw-r–r-- 1 external external 7 Feb 2 07:41 o
osmc@framboise:/media/Tera II/FTP$
as you can see, I was able using invite FTP login to store some files
Desperately I even to try to edit /etc/passwd and change home directory for olivier (the working one) from the sd card to the USB disk: no way (
I probably missed some key point but can’t understand why it works on the SDCard and not on the USB disk now it’s formatted as ex3
First do you want to have multiple logins? Then we have to make a group and add the users to that group and use “Match group” insted of “Match user” in sshd_config.
My first thought:
check the whole path, every directory before “home folder” and home folder, that the owner is root:root and the the file rights are 755 (rwxr-xr-x)
so /media should be root:root and drwxr-xr-x
/media/Tera II should be root:root and drwxr-x-r-x
/media/Tera II/FTP should be root:root drwxr-xr-x
if that so, Chroot %h in sshd_config should work. And the user should be jailed to that folder
(it looked like you FTP directory was 777, root:root drwxrwxrwx)
if you want to upload via SFTP, you have to make a foler in /media/Tera II/FTP, like:
sudo mkdir upload
sudo chown invite:invite upload
sudo chmod 777 upload