Limiting a user to scp and not ssh

George Toft plug-discuss@lists.plug.phoenix.az.us
Wed, 19 Jun 2002 23:35:54 -0400


KLUDGE: I noticed that during the scp operation, with bash as the shell,
a new shell is not spawned.  If a user ssh's into the box, a new shell
is spawned.  Put "exit" in ~/.bash_profile - as soon as they log in,
they log out.

Hopefully, there is a better solution, but this one works.  Let us know
how you proceed.

George


Matt Alexander wrote:
> 
> I'm trying to configure a box so people can scp files to it, but can't
> actually ssh in.  I created a script named scpsh with this in it:
> 
> #!/bin/sh
> #
> exec /usr/bin/scp -t $HOME
> 
> Then I added scpsh to /etc/shells and made it their shell in /etc/passwd.
> So now users can use scp to copy files over just fine, but when they try
> to ssh, it sits there until they hit a key, at which point they get:
> 
> scp: protocol error: unexpected <newline>
> Connection to 1.2.3.4 closed.
> 
> Is this the best way to handle this?  Is there a better way that anyone
> knows of?
> Thanks,
> ~M
> 
> ________________________________________________
> See http://PLUG.phoenix.az.us/navigator-mail.shtml if your mail doesn't post to the list quickly and you use Netscape to write mail.
> 
> PLUG-discuss mailing list  -  PLUG-discuss@lists.plug.phoenix.az.us
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss

--
If you feel you have received a virus from me, please read
	http://www.georgetoft.com/virus.html
because it wasn't me!
--