Subject: Re: scp-based drop box
To: Curt Sampson <cjs@cynic.net>
From: David Brownlee <abs@netbsd.org>
List: netbsd-users
Date: 10/10/2001 12:41:33
	What would the following do:
	    ssh -l copyuser some.host.com '`ls /etc| Mail bob@there`'
	Could also write outside $tapedir using '..'

-- 
		David/absolute		-- www.netbsd.org: No hype required --


On Wed, 10 Oct 2001, Curt Sampson wrote:

> On Tue, 9 Oct 2001, Erik Huizing wrote:
>
> > I'm trying to create an scp-based drop box, where a user can scp files to
> > the account, but can't log in and get a shell. Is what I'm tyring to do
> > even possible?
>
> I use a system very much like this for my backups. I've never tried scp,
> though. My trick is simply to copy stdin to a file using a simple shell
> script that replaces the users' shell in /etc/passwd:
>
>     #!/bin/sh
>     tapedir=/u/tape
>     umask 707
>     shift   # Get rid of first argument: -c
>     cat >"$tapedir/$1";
>
> You make sure there's an appropriate key in the authorized_keys file
> and then just do a "ssh -l copyuser some.host.com somefilename" and send
> the contents of "somefilename" to stdin of that command. Note that I set
> the modes and permissions such that you can't overwrite existing files.
>
> If anybody spots any security holes in this, I'd appreciate knowing
> about it of course.
>
> cjs
>