sftp question

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi list,

I'm not really familar with the ssh or sftp, so please forgive.

Would like to setup a sftp server on a linux box for secure file
exchange. Is it possible to connect to sshd without having a valid shell
  on the server like this :

 > cat /etc/passwd

---> snip


thanks in advance


Re: sftp question


  Richard Silverman

Re: sftp question

    FK> The simplest way to do this is to make the target account
    FK> special-purpose, by giving it a shell which only allows runing the
    FK> file-transfer server. SSH always uses the shell to run remote
    FK> programs, so this is a reliable restriction. SSH invokes the shell
    FK> program with the option -c program to run program; your
    FK> replacement should accept either scp with appropriate arguments,
    FK> or sftp-server, as appropriate. SSH2 comes with ssh-dummy-shell
    FK> for exactly this purpose, though naturally it only handles sftp.

    FK> ----

    FK> billy:x:700:1000::/home/billy:/usr/libexec/openssh/sft-server

    FK> would this be ok ?

It will, but only by accident; it happens that sftp-server ignores any
arguments.  In general, as the quoted text says, you would need a program
which acts like the shell in starting the program(s) you want.

  Richard Silverman

Site Timeline