Skip navigation.
Home
The QNX Community Portal

View topic - sftp in chroot

sftp in chroot

QNX Application portings.

sftp in chroot

Postby maschoen » Thu Aug 18, 2011 7:24 am

I'm using QNX 6.5 and my assignment is to get sftp working with the ChrootDirectory directive. I'm wondering if anyone else had been successful doing this. I've overcome one challenge already. sshd requires a pipe, but in a chroot jail, there is no /dev/pipe device. The solution was to start pipe in the same chroot jail from a program running as root.

Now I can login and have some functionality, for example, if there's a file xyz in my directory I can do this:

sftp> get /xyz

or if there is a directory abc I can do this

sftp> ls /abc

However a lot of stuff doesn't work. For example, If my chroot jail is /usr/test then

sftp> pwd

gives

/usr/test

which is wrong, it should be /

If I do this:

sftp> ls

I get an error that /usr/test doesn't exist.

And finally if I try

sftp> cd /abc
I get an error
Couldn't stat remote file: No such file or directory

Clearly something is broken. Can anyone help?
maschoen
QNX Master
 
Posts: 2640
Joined: Wed Jun 25, 2003 5:18 pm

Return to Porting

Who is online

Users browsing this forum: No registered users and 1 guest