| 1 | \versionid $Id: plink.but,v 1.10 2001/11/25 16:57:45 simon Exp $ |
| 2 | |
| 3 | \C{plink} Using the command-line connection tool Plink |
| 4 | |
| 5 | \i{Plink} (PuTTY Link) is a command-line connection tool similar to |
| 6 | UNIX \c{ssh}. It is probably not what you want if you want to run |
| 7 | an interactive session in a console window. |
| 8 | |
| 9 | \H{plink-starting} Starting Plink |
| 10 | |
| 11 | Plink is a command line application. This means that you cannot just |
| 12 | double-click on its icon to run it and instead you have to bring up a |
| 13 | \i{console window}. With Windows 95, 98, and ME, this is called an |
| 14 | \q{MS-DOS Prompt} and with Windows NT and 2000 it is called a |
| 15 | \q{Command Prompt}. It should be available from the Programs section |
| 16 | of your Start Menu. |
| 17 | |
| 18 | To start Plink it will need either to be on your \i{\c{PATH}} or in your |
| 19 | current directory. To add the directory containing Plink to your |
| 20 | \c{PATH} environment variable, type into the console window: |
| 21 | |
| 22 | \c set PATH=C:\path\to\putty\directory;%PATH% |
| 23 | |
| 24 | This will only work for the lifetime of that particular console |
| 25 | window. To set your \c{PATH} more permanently on Windows NT, use the |
| 26 | Environment tab of the System Control Panel. On Windows 95, 98, and |
| 27 | ME, you will need to edit your \c{AUTOEXEC.BAT} to include a \c{set} |
| 28 | command like the one above. |
| 29 | |
| 30 | \H{plink-usage} Plink Usage |
| 31 | |
| 32 | Once you've got a console window to type into, you can just type |
| 33 | \c{plink} on its own to bring up a usage message. This tells you the |
| 34 | version of Plink you're using, and gives you a brief summary of how to |
| 35 | use Plink: |
| 36 | |
| 37 | \c Z:\sysosd>plink |
| 38 | \c PuTTY Link: command-line connection utility |
| 39 | \c Release 0.50 |
| 40 | \c Usage: plink [options] [user@]host [command] |
| 41 | \c Options: |
| 42 | \c -v show verbose messages |
| 43 | \c -ssh force use of ssh protocol |
| 44 | \c -P port connect to specified port |
| 45 | \c -pw passw login with specified password |
| 46 | |
| 47 | \S{plink-usage-basics} The basics |
| 48 | |
| 49 | \S{plink-usage-options} Options |
| 50 | |
| 51 | These are the command line options that Plink accepts. |
| 52 | |
| 53 | \S2{plink-usage-options-v}\c{-v} show verbose messages |
| 54 | |
| 55 | By default, Plink only displays any password prompts and the output of |
| 56 | the remote command. The \c{-v} option makes it print extra |
| 57 | information about the connection being made, for example: |
| 58 | |
| 59 | \c Server version: SSH-1.5-OpenSSH-1.2.3 |
| 60 | \c We claim version: SSH-1.5-PuTTY |
| 61 | \c Using SSH protocol version 1 |
| 62 | \c Received public keys |
| 63 | \c Host key fingerprint is: |
| 64 | \c 1023 e3:65:44:44:bd:b1:04:59:bc:e2:3d:a1:4d:09:ce:99 |
| 65 | \c Encrypted session key |
| 66 | \c Using 3DES encryption |
| 67 | \c Trying to enable encryption... |
| 68 | \c Successfully started encryption |
| 69 | \c Sent username "fred". |
| 70 | \c Sent username "fred" |
| 71 | \c fred@example.com's password: |
| 72 | |
| 73 | This information can be useful for diagnosing problems. |
| 74 | |
| 75 | \S2{plink-usage-options-ssh}\c{-ssh} force use of ssh protocol |
| 76 | |
| 77 | \S2{plink-usage-options-P}\c{-P port} connect to specified port |
| 78 | |
| 79 | \S2{plink-usage-options-pw}\c{-pw passw} login with specified password |
| 80 | |
| 81 | \H{plink-pubkey} Using public key authentication with Plink |
| 82 | |
| 83 | \H{plink-batch} Using Plink in \i{batch files} and \i{scripts} |
| 84 | |
| 85 | \H{plink-cvs} Using Plink with \i{CVS} |
| 86 | |
| 87 | To use Plink with CVS, you need to set the environment variable |
| 88 | \c{CVS_RSH} to point to Plink: |
| 89 | |
| 90 | \c set CVS_RSH=\path\to\plink.exe |
| 91 | |
| 92 | You also need to arrange to be able to connect to a remote host |
| 93 | without a password. To do this, either: |
| 94 | |
| 95 | \b Run PuTTY, and create a PuTTY saved session (see |
| 96 | \k{config-saving}) with the protocol set to SSH (see |
| 97 | \k{config-hostname}) and specifies your private key file (see |
| 98 | \k{config-ssh-privkey}). You will probably also want to specify a |
| 99 | username to log in as (see \k{config-username}). You should then be |
| 100 | able to run CVS as follows: |
| 101 | |
| 102 | \c cvs -d :ext:user@sessionname:/path/to/repository co module |
| 103 | |
| 104 | If you specified a username in your saved session, you can just say: |
| 105 | |
| 106 | \c cvs -d :ext:sessionname:/path/to/repository co module |
| 107 | |
| 108 | Alternatively, you can use Pageant if Pageant is running (see |
| 109 | \k{pageant}). To do this, you would: |
| 110 | |
| 111 | \b Ensure Pageant is running, and has your private key stored in it. |
| 112 | |
| 113 | \b Set the environment variable \cw{PLINK_PROTOCOL} to the string |
| 114 | \c{ssh}, to make sure Plink will try to connect using SSH instead of |
| 115 | Telnet. |
| 116 | |
| 117 | \b Run CVS as follows: |
| 118 | |
| 119 | \c cvs -d :ext:user@hostname:/path/to/repository co module |
| 120 | |
| 121 | \H{plink-wincvs} Using Plink with \i{WinCVS} |
| 122 | |
| 123 | Plink can also be used with WinCVS. Firstly, arrange for Plink to be |
| 124 | able to connect to a remote host without a password. \k{plink-cvs} |
| 125 | has instructions on this. |
| 126 | |
| 127 | In WinCVS, bring up the \e{Preferences} dialogue box from the |
| 128 | \e{Admin} menu, and switch to the \e{Ports} tab. Tick the box there |
| 129 | labelled \e{Check for an alternate rsh name} and in the text entry |
| 130 | field to the right enter the full path to \c{plink.exe}. Select |
| 131 | \e{OK} on the \e{Preferences} dialogue box. |
| 132 | |
| 133 | Next, select \e{Command Line} from the WinCVS \e{Admin} menu, and type |
| 134 | a CVS command as in \k{plink-cvs}, for example: |
| 135 | |
| 136 | \c cvs -d :ext:user@hostname:/path/to/repository co module |
| 137 | |
| 138 | Select the folder you want to check out to with the \e{Change Folder} |
| 139 | button, and click \e{OK} to check out your module. Once you've got |
| 140 | modules checked out, WinCVS will happily invoke plink from the GUI for |
| 141 | CVS operations. |
| 142 | |
| 143 | \H{plink-whatelse} Using Plink with... ? |
| 144 | |