Found a bug using sftp

first thanks for an excellant script it works great

i have found one little problem when using sftp as a user it gives access to the whole drive if you use port 4747 sftp you cant write to this but you can see everything that is on the drive

in ssh this is not possible as the user is locked into his directory but in sftp it isnt

any ideas how i can stop this

thanks guys

The best way to handle this for now is to turn off the sftp option within lshell.

You can do this by way of /etc/lshell.conf. Change the line sftp : 1 to sftp : 0. Connections on port 5757 for FTP access are handled by TLS.

That is an unfortunate limitation with LShell. It creates a shelled bash environment but fails to do so with SFTP. I am actually looking into using jailkit rather than LShell… this way users have a true jailed shell and not a limited shell with a python ssh environment.

thankyou for the quick reply JMSolo

i have just checked /etc/lshell.conf and it is set to sftp : 0 must be by default

ime blind with lshell never used it at all

What version of QuickBox are you using?

2.2.1 is the version installed

Hmm, I wonder if for some reason the user didn’t get added to the proper shell.

Could you open the /etc/passwd file and see if the user has something like this:


If so, it will need to be changed to this:


No reboot needed, now try to connect with the user to SFTP.

this is strange as there are no users in there

list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nolog$

i have added 2 users andrew and test

What is your distro and release? That is unlike any behavior I have ever seen. :confused:

Could you provide me with your /root/.bashrc file. Rename it to bashrc.log and upload it here. There is nothing sensitive in the file… just some standard system commands. Something certainly isn’t adding up here.

If you are able to connect to the user and they have a connection to RTorrent, they should have an entry in that file. Do you see them by chance in /etc/htpasswd?

Try this also:

sudo -u test chsh -s /usr/bin/lshell

The password is prompting for that users password. Let me know if it returns some sort of error.


yes thay are in there


.bashrc.log (16.0 KB)

[root@sd-78876]:(1.5Mb)~# sudo -u test chsh -s /usr/bin/lshell
chsh: PAM: Authentication failure

there is nothing sensitive ias i will be reinstalling the server once i have this working ok with a fresh install i am using ubuntu 14.04 at onepanel.op

What FTP client are you currently connecting with?

Also, your .bashrc looks good.

Could you try this out real quick… just copy it exactly

useradd -m -k /etc/skel/ qbtester -s /usr/bin/lshell
passwd qbtester

For the password, just place password or something simple.

Now check the /etc/passwd file to see if the user is there.
Then check the /home directory for the user qbtester .

sorry for taking up your time here

the user has been created in the home directory and in the passwd file

No worries… I tend to have time.

What happens now if you were to attempt connecting to that user via FTP and SFTP?

i cant connect using sftp 4747 but i can connect using ftp 5757 yay thanks my friend :smiley:

Wonderful… and now since those two users are missing from the passwd file… you can do this to add them there manually. I will run some test against this on 14.04 later today (in all honesty it’s been neglected in the dawn of 16.04).

id -u test

That should output the UID of that user… do the same for your other user that is not in there.

Now that you have those UID’s… add them to the bottom of that /etc/passwd file.


Do that for both users, and be sure to change UID and username with the appropriate user/uid.

ok thankyou very much for your help today

take care

warmest regards