unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Jonathan Walther <krooger@debian.org>
Cc: gnu-arch-users@gnu.org, savannah-hackers@gnu.org,
	xouvert-general@nongnu.org, emacs-devel@gnu.org
Subject: Re: possible fix for sftp on Savannah; please try
Date: Mon, 13 Oct 2003 15:41:38 -0700	[thread overview]
Message-ID: <20031013224138.GA21254@reactor-core.org> (raw)
In-Reply-To: <m365j2t836.fsf@dionysos.nib>


[-- Attachment #1.1: Type: text/plain, Size: 2480 bytes --]

On Mon, Oct 06, 2003 at 10:38:37PM +0200, Mathieu Roy wrote:
>> The errors always mention premature EOF on file descriptor 4.
>> 
>> If you could install chroot-sftp.c, that would be a tremendous help in
>> tracking down the problem.
>
>Firstly, I would to know why the current thing does not work for you
>while it works for me and while I was told by several others persons,
>including arch users, that it works ok.

When did you last test it?  I finally got a regular Savannah user
account, and talked to other regular Savannah users, and unless they use
ssh protocol 1, which you CANNOT chroot, they also are not able to sftp
into Savannah.  If you want only chrooted sftp you have to disable ssh
protocol 1 entirely.

The shell closes all file descriptors except 0, 1, and 2 before passing
them on to programs.  The sftp server expects to by invoked by sshd, not
by a shell script, and so it is waiting for incoming data on file
descriptor 4.

For this reason I have to request you to do the following on Savannah:

  cd ~djw
  make chroot-sftp
  cp chroot-sftp /usr/local/bin

Then in /etc/ssh/sshd_config, make sure the sftp subsystem is set like
so:

  Subsystem	sftp	/usr/local/bin/chroot-sftp

Restart sshd and let us know so we can test it.

Good luck.

Jonathan

PS: Just so you can look over the source code of chroot-sftp.c, here it
is.

/* chroot-sftp.c krooger@debian.org Sat Oct 11 21:55:36 EDT 2003
 *
 * Allows chrooted sftp access for Savannah projects.
 *
 * Ensures that all file descriptors opened by the ssh session, such as
 * 4 and up, are passed to the sftp-server program.
 */

#include <unistd.h>

int
main(int argc, char** argv)
{
        chroot("/upload");
        execl("/usr/lib/sftp-server", "/usr/lib/sftp-server", NULL);
}

/*
 * arch-tag: savannah:/home/djw/chroot-sftp.c
 */

-- 

    It's not true unless it makes you laugh,                           
             but you don't understand it until it makes you weep.      

    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

                     Geek House Productions, Ltd.

  Providing Unix & Internet Contracting and Consulting,
  QA Testing, Technical Documentation, Systems Design & Implementation,
  General Programming, E-commerce, Web & Mail Services since 1998

Phone:   604-435-1205
Email:   djw@reactor-core.org
Webpage: http://reactor-core.org
Address: 13685 Hilton Road, Surrey, BC

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 307 bytes --]

[-- Attachment #2: Type: text/plain, Size: 214 bytes --]

_______________________________________________
Gnu-arch-users mailing list
Gnu-arch-users@gnu.org
http://mail.gnu.org/mailman/listinfo/gnu-arch-users

GNU arch home page:
http://savannah.gnu.org/projects/gnu-arch/

       reply	other threads:[~2003-10-13 22:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20031006112435.GA11164@reactor-core.org>
     [not found] ` <m3u16mv9dn.fsf@dionysos.nib>
     [not found]   ` <20031006193845.GA20395@reactor-core.org>
     [not found]     ` <m365j2t836.fsf@dionysos.nib>
2003-10-13 22:41       ` Jonathan Walther [this message]
2003-10-14 10:06         ` possible fix for sftp on Savannah; please try Mathieu Roy
2003-10-14 11:14         ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031013224138.GA21254@reactor-core.org \
    --to=krooger@debian.org \
    --cc=emacs-devel@gnu.org \
    --cc=gnu-arch-users@gnu.org \
    --cc=savannah-hackers@gnu.org \
    --cc=xouvert-general@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).