Re: Putty: PSFTP connection without password prompt (CORRECT VERSION)

From: Jack Moe (mojorisin_at_bigmailbox.net)
Date: 04/08/04


Date: 8 Apr 2004 12:00:40 -0700

s_federici@yahoo.com (Stefano) wrote in message news:<4dcaebfc.0404080127.77fcd3d7@posting.google.com>...
> > Why don't you use 'pscp' with null passphrases? You then have a
> > single command line to copy your file(s) in a batch file.
>
> Well, what should I say if not: thanks, thanks, thanks, thanks!!!!
>
> I spent 2 weeks to learn a lot (from my point of view, I know) about
> secure transfer of files:
> 1. FPTS is NOT SFTP

Not sure what FPTS is. . . either; what is it?

> 2. You can transfer files with a LOT of different tools.

Yup. . .

> BUT
> PSCP (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html)
> is the answer in the following case:
> 1. you are sending files to a server running SSH
> 2. you don't want an interactive shell
> 3. you are working in windows

Also:
4. You don't want to use the "-pw <password>" option, as this is no
better than putting passwords in FTP UNIX '.netrc' files or imbedding
them in your script

> The incredibly simple line to use (as a future reference for novice
> users like me) is something like the following:
>
> pscp -pw yourpassword -P serverPortForSFTP yourfile
> username@host:folder/filetoupload

That is very un-secure. Set up a NULL passphrase (not password) using
'puttygen' to generate the RSA key and then put the public key on the
SSH server.

If you're running SSH on a UNIX server, you may also want to use
'rssh' as the default user shell so that user cannot SSH into the
system and get a shell, but only copy files.

> In my case:
>
> pscp -pw JuveXXXXXX -P 22 stats.gif
> presXXX@vaxcaXXX.unica.it:www/stats.gif
> (I partially hidden some parts for security reasons).

All you need is:
pscp <filename> user@host:<filename>

The NULL passphrase authenticates the user without prompting (like
.rhosts files for 'rcp'). Make sure the account that's transfering
the file does not have admin privs. . . otherwise any user knowing
that this trust is set up will expoit this and attempt to SSH straight
into the system (reason for using 'rssh' as the shell).

Does this help a little bit more, or did I misunderstand your second
post as understanding already?

MJ



Relevant Pages

  • Re: Did you hack into my UNIX server Bible Bob?
    ... try "traceroute" to see if the routes to your server are up. ... yet allow me to FTP and ssh in? ... firewall rules to block everything except for SSH traffic from one ... But that's not a shell question. ...
    (comp.unix.shell)
  • Re: Ssh problem
    ... when I ssh from one machine to another (both RedHat ... > return after exiting from the remote shell. ... process on the server side and try to exit, ...
    (RedHat)
  • Re: SFTP is not working
    ... When I try to use sftp or scp2, I get a message like this: ... sftp and scp2 both actually work by running ssh in a subprocess, ... The reason the shell startup files are relevant at all, ...
    (comp.security.ssh)
  • Re: ssh X11forwarding wont work, please help
    ... whereas saying "export DISPLAY made me think "the display server". ... set by ssh, the shell freezes after i start an x application. ... rules and the X Server at machine1 is listening for TCP connections. ...
    (comp.os.linux.x)
  • Re: Did you hack into my UNIX server Bible Bob?
    ... But that's not a shell question. ... >> OSX users, should I be using ssh instead of telnet for security? ... OSX as a built in firewall tab. ...
    (comp.unix.shell)