chroot Problem with transferring files + groups/id error
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I had the exact same problem. After googling a bit for a solution (and finding your post), it began to look like setting up both the server (Openssh) and the client (WinSCP) to use sftp rather than scp would be easier to set up, and that proved to be true.
That also allows you to get rid of the bin and etc directories in the chroot jail (you still need lib, but not termcap).
Your chrooted user shell just needs to be sftp-server.
Note that here I also set up the chroot jail so that the .ssh directory is not visible after the user logs on.
I forgot to mention: you need to make the sftp-server binary in your chroot jail setuid/setgrpid of your restricted user (sshguest in my case), or else your remote users will be running as root (albeit in the chroot jail). Permission should look like this:
I had a silimilar problem with HPUX and chroot user with openssh scp command, I solve this problem made truss for HPUX, Linux use strace.
The most common error when you configure chroot is that the system can't find libs in chroot lib directory.
Steps:
Run strace over some user for example root when this user use id or uid command and test if the libs are the same that you have into chroot lib directory, in my case work it and I can find the lib.
Put the lib into chroot lib directoy and test scp command.
I hope that explation help you.
Last edited by Alvaro martinez; 10-29-2003 at 03:35 AM.
In my case, completely same problem had occurred in Intel Solaris 8.0 system.
SCP cause errors because of unknown user, and groups command also reports the same error. So I ran the next command -"truss -fd -p (pid of inted)" in console, and then accessed from client by WinSCP in WinXP. In my machine, OpenSSH-Chroot was called from inetd with tcp-wrappers.
Then in console, I found some errors. Mainly thy were reports of missing files such as "/etc/nsswitch.conf", "/usr/lib/nss_files.so.1", and "/usr/lib/nss_nis.so.1". (Only checking ERR characters in console.)
In linux system, as formerly mentioned, please check file missing errors using "strace -f -e -p (pid)".
After adding missing files, SCP, groups, id commands ran successfully via WinSCP.
Best Regards.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.