PSCP, the PuTTY Secure Copy client, is a tool for transferring files securely between computers using an SSH connection. If you have an SSH-2 server, you might prefer PSFTP (see chapter 6) for interactive use. PSFTP does not in general work with SSH-1 servers, however. This means that you cannot just double-click on its icon to run it and instead you have to bring up a console window. With Windows 95, 98, and ME, this is called an ‘MS-DOS Prompt’ and with Windows NT, 2000, and XP, it is called a ‘Command Prompt’. It should be available from the Programs section of your Start Menu. Set PATH=C:\path\to\putty\directory %PATH% To add the directory containing PSCP to your PATH environment variable, type into the console window: To start PSCP it will need either to be on your PATH or in your current directory. This will only work for the lifetime of that particular console window. To set your PATH more permanently on Windows NT, 2000, and XP, use the Environment tab of the System Control Panel. On Windows 95, 98, and ME, you will need to edit your AUTOEXEC.BAT to include a set command like the one above. This tells you the version of PSCP you're using, and gives you a brief summary of how to use PSCP: Once you've got a console window to type into, you can just type pscp on its own to bring up a usage message. (PSCP's interface is much like the Unix scp command, if you're familiar with that.) unsafe allow server-side wildcards (DANGEROUS) i key private key file for authentication 1 -2 force use of particular SSH protocol version load sessname Load settings from saved session pgpfp print PGP key fingerprints and exit Pscp source -ls print version information and exit Putty download chiark home page how to# Pscp c:\documents\foo.txt can use wildcards to transfer multiple files in either direction, like this: Pscp source to copy the local file c:\documents\foo.txt to the server as user fred to the file /tmp/foo you would type: So to copy the file /etc/hosts from the server as user fred to the file c:\temp\example-hosts.txt, you would type: To receive (a) file(s) from a remote server: However, in the second case (using a wildcard for multiple remote files) you may see a warning saying something like ‘warning: remote host tried to write to a file called ‘ terminal.c’ when we requested a file called ‘ *.c’. If this is a wildcard, consider upgrading to SSH-2 or using the ‘ -unsafe’ option. Renaming of this file has been disallowed’. This is due to a fundamental insecurity in the old-style SCP protocol: the client sends the wildcard string ( *.c) to the server, and the server sends back a sequence of file names that match the wildcard pattern. However, there is nothing to stop the server sending back a different pattern and writing over one of your other files: if you request *.c, the server might send back the file name AUTOEXEC.BAT and install a virus for you. Since the wildcard matching rules are decided by the server, the client cannot reliably verify that the filenames sent back match the pattern. PSCP will attempt to use the newer SFTP protocol (part of SSH-2) where possible, which does not suffer from this security flaw. If you really need to use a server-side wildcard with an SSH-1 server, you can use the -unsafe command line option with PSCP: (You can force use of the SFTP protocol, if available, with -sftp - see section 5.2.2.6.) If you are talking to an SSH-2 server which supports SFTP, you will never see this warning. This will suppress the warning message and the file transfer will happen. However, you should be aware that by using this option you are giving the server the ability to write to any file in the target directory, so you should only use this option if you trust the server administrator not to be malicious (and not to let the server machine be cracked by malicious people). Putty download chiark home page download#Īlternatively, do any such download in a newly created empty directory. (Even in ‘unsafe’ mode, PSCP will still protect you against the server trying to get out of that directory using pathnames including ‘. If this is omitted, and host is a PuTTY saved session, PSCP will use any username specified by that saved session.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |