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