[scponly] Can't transfer files with SCP

Håkan Terelius hakanterelius at hotmail.com
Fri Aug 20 04:22:04 EDT 2004


Hi
Thanks for your answers

When I added the "//home" in /etc/passwd it worked perfectly. Thanks.

About the sftp-binary:
I have other users who isn't chrooted, and for them everything works fine, 
both with scp and sftp.
In my sshd_config file I have the line:
Subsystem	  sftp	/usr/libexec/ssh/sftp-server

(the sshd_config file is outside my chrooted directory, in /etc/ssh)
The chrooted directory tree looks like:
/usr/bin/groups
/usr/bin/id
/usr/bin/scp
/usr/lib/libcrypto.so.0.9.7
/usr/lib/libz.so.1
/usr/libexec/ssh/sftp-server
/lib/ld-linux.so.2
/lib/libc.so.6
/lib/libcrypt.so.1
/lib/libdl.so.2
/lib/libnsl.so.1
/lib/libnss_compat-2.3.2.so
/lib/libnss_compat.so.2
/lib/libpthread.so.0
/lib/libresolv.so.2
/lib/librt.so.1
/lib/libutil.so.1
/home      users-file-directory
/etc/ld.so.cache
/etc/ld.so.conf
/etc/passwd
/bin/chgrp
/bin/chmod
/bin/chown
/bin/echo
/bin/ln
/bin/ls
/bin/mkdir
/bin/mv
/bin/pwd
/bin/rm
/bin/rmdir
/Maildir    user-mail
/.bash_logout
/.bash_profile
/.bashrc
/.inputrc

Both sftp-server and scp exist inside the chrooted directory, and outside 
it, everything works fine.
Could it be something about the PATH when the user is chrooted?


Thanks for your time
Hakan Terelius
hakanterelius at hotmail.com



>From: Hammad <hammad at brisksolutions.com>
>To: scponly at lists.ccs.neu.edu
>Subject: Re: [scponly] Can't transfer files with SCP
>Date: Wed, 18 Aug 2004 12:15:05 -0400
>
>To place user directly into its home directory. In your /etc/passwd use 
>'//'
>double forward slashes. For example:
>
>user1:x:1001:1001:Test 
>User:/clients/abc-company//home:/usr/local/sbin/scponlyc
>
>After login, user1 will be place in its 'home' directory and his chroot'ed 
>upto
>/clients/abc-company/
>
>Hope this helps.
>
>--
>Hammad
>
>
>Quoting Anthony Brock <Anthony_Brock at ous.edu>:
>
>| Check to ensure that you've installed the subsystem (the sftp-server 
>binary)
>| in the chrooted environment. For example, on my system this is located 
>at:
>|
>| /usr/lib/ssh/sftp-server
>|
>| The exact location can be determined by looking at the 'Subsystem' 
>directive
>| within SSH's sshd_config file:
>|
>| Subsystem       sftp    /usr/lib/ssh/sftp-server
>|
>| I wish I had a good answer for your last question. Unfortunately, I 
>haven't
>| found a way to "automatically" place SFTP users in a writeable directory.
>|
>| Tony
>|
>|
>| >>> Håkan Terelius <hakanterelius at hotmail.com> 08/18/04 12:19AM >>>
>| Hi everybody
>|
>| I have installed scponly on my linux server with chroot enabled.
>| Then I created a user with the "make jail" script.
>| I use WinSCP to connect to my server, and if I select "sftp" everything
>| works fine, but when I selected "scp" I got the message about the
>| "groups"-file, so I copied groups to /*chrooted user*/usr/bin/groups. 
>After
>| that I can log in with scp, but when I tries to transfer a file I get the
>| error message
>| "Cannot execute SCP to start transfer. Please make sure that SCP is
>| installed on the server and path to it is included in PATH. You may also 
>try
>|
>| SFTP instead of SCP.
>| Command failed with return code 255."
>|
>| It sounds like a very simpel error, but I'm quite new on linux. The 
>strange
>| thing is that I have the scp binary in /*chrooted user*/usr/bin/scp
>| I have also checked "ldd scp" and all those librarys exist there.
>| Does anyone have any suggestions about what I could do to solve this?
>|
>| I have an other question too.
>| When the user logs in, he enters the chroot directory and not his 
>writable
>| home folder.
>| Is it possibly to make a login script that changes his directory when he
>| logs in.
>| I have tried to add "cd home" in the ".bash_profile"-file, but it seems 
>that
>|
>| scponly doesn't execute that file, so is there an other way to make a 
>login
>| script?
>|
>|
>| Thanks for your time
>| Hakan Terelius
>| hakanterelius at hotmail.com
>|
>| _________________________________________________________________
>| Lättare att hitta drömresan med MSN Resor http://www.msn.se/resor/
>|
>|
>| _______________________________________________
>| scponly mailing list
>| scponly at lists.ccs.neu.edu
>| https://lists.ccs.neu.edu/bin/listinfo/scponly
>|
>|
>| _______________________________________________
>| scponly mailing list
>| scponly at lists.ccs.neu.edu
>| https://lists.ccs.neu.edu/bin/listinfo/scponly
>|
>
>
>_______________________________________________
>scponly mailing list
>scponly at lists.ccs.neu.edu
>https://lists.ccs.neu.edu/bin/listinfo/scponly

_________________________________________________________________
Chatt: Träffa nya nätkompisar på Habbo Hotel 
http://habbohotel.msn.se/habbo/sv/channelizer




More information about the scponly mailing list