Hello,

The home directory of user accounts must be inside chroot to work
properly.

For instance, in system /etc/passwd

apple:x:1001:1001::/usr/chroot/home/apple:/usr/bin/rssh

Then also define home directory inside chroot in /usr/chroot/etc/passwd

apple:x:1001:1001::/home/apple:/bin/false

Here, I use "/bin/false" as I do not expect users to start interactive
shell inside chroot.

Of course you have to:
chown -R apple /usr/chroot/home/apple


With these two "passwd" settings, you can browse
"/usr/chroot/home/apple" from your host system with proper handling of
UID/GID, and applications allowed to run by rssh inside chroot have
required information about user too.

Regards
Yves Martin


On Wed, 2015-11-18 at 08:43 +0300, Елизавета Остолоповa wrote:

> On Debian 8.2
> I created a chroot using the supplied script.
> 
> cat /etc/rssh.conf
> .....
> user = "apple:011:100010:/usr/chroot"
> 
> cat /usr/chroot/passwd
> apple:x:1001:1001::/mnt/apple:/usr/bin/rssh
> 
> Now when I upload a file using scp, it gives permission denied. When I
> do this:
> mkdir /usr/chroot/orange
> chmod 777 /usr/chroot/orange
> 
> scp document ap...@example.com:/orange/.
> 
> it works. It does upload. What is the problem here? Even if I give 777
> permissions to /mnt/apple it gives permission denied.
> 
> I guess the problem is that scp does not automatically select the
> user's home directory. I have to manually specify it.
> scp document ap...@example.com:homedir/.
> This works.
> But this does not work:
> scp document ap...@example.com:.
> Normally this should work. So my question is how can I have scp to
> choose the user's home directory automatically?
> I tried to change the user home dir both in
> /etc/passwd
> and in
> /usr/chroot/etc/passwd
> Neither did not work.

------------------------------------------------------------------------------
_______________________________________________
rssh-discuss mailing list
rssh-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rssh-discuss

Reply via email to