不知道为什么在网上搜
putty
命令都是linux
命令,难道我说的putty
命令真的是说法错了,无奈我只能到官网找资料了。
help me !!!
putty 命令:
1. putty 界面上运行的命令(直接说linux命令就好了呀)
2. 启动putty时所用的命令(正是我要找的)
这里记录一下以后可能会用到的命令,更多命令用到就到官网查询了
。
传参方式:
`putty.exe [-ssh | -telnet | -rlogin | -raw] [user@]host`
例如:
putty.exe telnet://host[:port]/
putty.exe -serial com1
putty.exe -load "session name"
设置登陆选项: -ssh',
-telnet’, -rlogin',
-raw’ `-
serial’
To choose which protocol you want to connect with, you can use one
of these options:
- `-ssh' selects the SSH protocol.
- `-telnet' selects the Telnet protocol.
- `-rlogin' selects the Rlogin protocol.
- `-raw' selects the raw protocol.
- `-serial' selects a serial connection.
-L',
-R’ and `-D’:
设置端口映射
putty -L 5110:popserver.example.com:110 -load mysession
plink mysession -L 5110:popserver.example.com:110
图形界面多麻烦呀
下面的命令目前我没有常用copy下来,以后用到了再来找。
3.8.3.6 `-m’: read a remote command or script from a file
The `-m' option performs a similar function to the `Remote command'
box in the SSH panel of the PuTTY configuration box (see section
4.18.1). However, the `-m' option expects to be given a local file
name, and it will read a command from that file.
With some servers (particularly Unix systems), you can even put
multiple lines in this file and execute more than one command in
sequence, or a whole shell script; but this is arguably an abuse,
and cannot be expected to work on all servers. In particular, it is
known _not_ to work with certain `embedded' servers, such as Cisco
routers.
This option is not available in the file transfer tools PSCP and
PSFTP.
3.8.3.7 `-P’: specify a port number
The `-P' option is used to specify the port number to connect to. If
you have a Telnet server running on port 9696 of a machine instead
of port 23, for example:
putty -telnet -P 9696 host.name
plink -telnet -P 9696 host.name
(Note that this option is more useful in Plink than in PuTTY,
because in PuTTY you can write `putty -telnet host.name 9696' in any
case.)
This option is equivalent to the port number control in the Session
panel of the PuTTY configuration box (see section 4.1.1).
3.8.3.8 `-pw’: specify a password
A simple way to automate a remote login is to supply your password
on the command line. This is _not recommended_ for reasons of
security. If you possibly can, we recommend you set up public-key
authentication instead. See chapter 8 for details.
Note that the `-pw' option only works when you are using the SSH
protocol. Due to fundamental limitations of Telnet and Rlogin, these
protocols do not support automated password authentication.
3.8.3.9 -agent' and
-noagent’: control use of Pageant for authentication
The `-agent' option turns on SSH authentication using Pageant, and
`-noagent' turns it off. These options are only meaningful if you
are using SSH.
See chapter 9 for general information on Pageant.
These options are equivalent to the agent authentication checkbox in
the Auth panel of the PuTTY configuration box (see section 4.22.3).
3.8.3.10 -A' and
-a’: control agent forwarding
The `-A' option turns on SSH agent forwarding, and `-a' turns it
off. These options are only meaningful if you are using SSH.
See chapter 9 for general information on Pageant, and section 9.4
for information on agent forwarding. Note that there is a security
risk involved with enabling this option; see section 9.5 for
details.
These options are equivalent to the agent forwarding checkbox in the
Auth panel of the PuTTY configuration box (see section 4.22.6).
These options are not available in the file transfer tools PSCP and
PSFTP.
3.8.3.11 -X' and
-x’: control X11 forwarding
The `-X' option turns on X11 forwarding in SSH, and `-x' turns it
off. These options are only meaningful if you are using SSH.
For information on X11 forwarding, see section 3.4.
These options are equivalent to the X11 forwarding checkbox in the
X11 panel of the PuTTY configuration box (see section 4.25).
These options are not available in the file transfer tools PSCP and
PSFTP.
3.8.3.12 -t' and
-T’: control pseudo-terminal allocation
The `-t' option ensures PuTTY attempts to allocate a pseudo-terminal
at the server, and `-T' stops it from allocating one. These options
are only meaningful if you are using SSH.
These options are equivalent to the `Don't allocate a pseudo-
terminal' checkbox in the SSH panel of the PuTTY configuration box
(see section 4.24.1).
These options are not available in the file transfer tools PSCP and
PSFTP.
3.8.3.13 `-N’: suppress starting a shell or command
The `-N' option prevents PuTTY from attempting to start a shell or
command on the remote server. You might want to use this option if
you are only using the SSH connection for port forwarding, and your
user account on the server does not have the ability to run a shell.
This feature is only available in SSH protocol version 2 (since the
version 1 protocol assumes you will always want to run a shell).
This option is equivalent to the `Don't start a shell or command at
all' checkbox in the SSH panel of the PuTTY configuration box (see
section 4.18.2).
This option is not available in the file transfer tools PSCP and
PSFTP.
3.8.3.14 `-nc’: make a remote network connection in place of a remote shell
or command
The `-nc' option prevents Plink (or PuTTY) from attempting to start
a shell or command on the remote server. Instead, it will instruct
the remote server to open a network connection to a host name and
port number specified by you, and treat that network connection as
if it were the main session.
You specify a host and port as an argument to the `-nc' option, with
a colon separating the host name from the port number, like this:
plink host1.example.com -nc host2.example.com:1234
You might want to use this feature if you needed to make an SSH
connection to a target host which you can only reach by going
through a proxy host, and rather than using port forwarding you
prefer to use the local proxy feature (see section 4.15.1 for more
about local proxies). In this situation you might select `Local'
proxy type, set your local proxy command to be `plink %proxyhost -
nc %host:%port', enter the target host name on the Session panel,
and enter the directly reachable proxy host name on the Proxy panel.
This feature is only available in SSH protocol version 2 (since the
version 1 protocol assumes you will always want to run a shell). It
is not available in the file transfer tools PSCP and PSFTP. It is
available in PuTTY itself, although it is unlikely to be very useful
in any tool other than Plink. Also, `-nc' uses the same server
functionality as port forwarding, so it will not work if your server
administrator has disabled port forwarding.
(The option is named `-nc' after the Unix program `nc', short for
`netcat'. The command `plink host1 -nc host2:port' is very similar
in functionality to `plink host1 nc host2 port', which invokes `nc'
on the server and tells it to connect to the specified destination.
However, Plink's built-in `-nc' option does not depend on the `nc'
program being installed on the server.)
3.8.3.15 `-C’: enable compression
The `-C' option enables compression of the data sent across the
network. This option is only meaningful if you are using SSH.
This option is equivalent to the `Enable compression' checkbox in
the SSH panel of the PuTTY configuration box (see section 4.18.3).
3.8.3.16 -1' and
-2’: specify an SSH protocol version
The `-1' and `-2' options force PuTTY to use version 1 or version 2
of the SSH protocol. These options are only meaningful if you are
using SSH.
These options are equivalent to selecting the SSH protocol version
in the SSH panel of the PuTTY configuration box (see section
4.18.4).
3.8.3.17 -4' and
-6’: specify an Internet protocol version
The `-4' and `-6' options force PuTTY to use the older Internet
protocol IPv4 or the newer IPv6 for most outgoing connections.
These options are equivalent to selecting your preferred Internet
protocol version as `IPv4' or `IPv6' in the Connection panel of the
PuTTY configuration box (see section 4.13.4).
3.8.3.18 `-i’: specify an SSH private key
The `-i' option allows you to specify the name of a private key file
in `*.PPK' format which PuTTY will use to authenticate with the
server. This option is only meaningful if you are using SSH.
If you are using Pageant, you can also specify a _public_ key file
(in RFC 4716 or OpenSSH format) to identify a specific key file to
use. (This won't work if you're not running Pageant, of course.)
For general information on public-key authentication, see chapter 8.
This option is equivalent to the `Private key file for
authentication' box in the Auth panel of the PuTTY configuration box
(see section 4.22.8).
3.8.3.19 `-loghost’: specify a logical host name
This option overrides PuTTY's normal SSH host key caching policy by
telling it the name of the host you expect your connection to end up
at (in cases where this differs from the location PuTTY thinks it's
connecting to). It can be a plain host name, or a host name followed
by a colon and a port number. See section 4.13.5 for more detail on
this.
3.8.3.20 `-hostkey’: manually specify an expected host key
This option overrides PuTTY's normal SSH host key caching policy
by telling it exactly what host key to expect, which can be
useful if the normal automatic host key store in the Registry is
unavailable. The argument to this option should be either a host key
fingerprint, or an SSH-2 public key blob. See section 4.20.2 for
more information.
You can specify this option more than once if you want to configure
more than one key to be accepted.
3.8.3.21 `-pgpfp’: display PGP key fingerprints
This option causes the PuTTY tools not to run as normal, but instead
to display the fingerprints of the PuTTY PGP Master Keys, in
order to aid with verifying new versions. See appendix E for more
information.
3.8.3.22 `-sercfg’: specify serial port configuration
This option specifies the configuration parameters for the serial
port (baud rate, stop bits etc). Its argument is interpreted as
a comma-separated list of configuration options, which can be as
follows:
- Any single digit from 5 to 9 sets the number of data bits.
- `1', `1.5' or `2' sets the number of stop bits.
- Any other numeric string is interpreted as a baud rate.
- A single lower-case letter specifies the parity: `n' for none,
`o' for odd, `e' for even, `m' for mark and `s' for space.
- A single upper-case letter specifies the flow control: `N' for
none, `X' for XON/XOFF, `R' for RTS/CTS and `D' for DSR/DTR.
For example, `-sercfg 19200,8,n,1,N' denotes a baud rate of 19200, 8
data bits, no parity, 1 stop bit and no flow control.
3.8.3.23 -sessionlog',
-sshlog’, `-sshrawlog’: specify session logging
These options cause the PuTTY network tools to write out a log
file. Each of them expects a file name as an argument, e.g. `-
sshlog putty.log' causes an SSH packet log to be written to a file
called `putty.log'. The three different options select different
logging modes, all available from the GUI too:
- `-sessionlog' selects `All session output' logging mode.
- `-sshlog' selects `SSH packets' logging mode.
- `-sshrawlog' selects `SSH packets and raw data' logging mode.
For more information on logging configuration, see section 4.2.
3.8.3.24 `-proxycmd’: specify a local proxy command
This option enables PuTTY's mode for running a command on the local
machine and using it as a proxy for the network connection. It
expects a shell command string as an argument.
See section 4.15.1 for more information on this, and on other proxy
settings. In particular, note that since the special sequences
described there are understood in the argument string, literal
backslashes must be doubled (if you want `\' in your command, you
must put `\\' on the command line).
3.8.3.25 `-restrict-acl’: restrict the Windows process ACL
This option (on Windows only) causes PuTTY (or another PuTTY tool)
to try to lock down the operating system's access control on its own
process. If this succeeds, it should present an extra obstacle to
malware that has managed to run under the same user id as the PuTTY
process, by preventing it from attaching to PuTTY using the same
interfaces debuggers use and either reading sensitive information
out of its memory or hijacking its network session.
This option is not enabled by default, because this form of
interaction between Windows programs has many legitimate uses,
including accessibility software such as screen readers. Also,
it cannot provide full security against this class of attack in
any case, because PuTTY can only lock down its own ACL _after_ it
has started up, and malware could still get in if it attacks the
process between startup and lockdown. So it trades away noticeable
convenience, and delivers less real security than you might want.
However, if you do want to make that tradeoff anyway, the option is
available.
A PuTTY process started with `-restrict-acl' will pass that on to
any processes started with Duplicate Session, New Session etc.
(However, if you're invoking PuTTY tools explicitly, for instance as
a proxy command, you'll need to arrange to pass them the `-restrict-
acl' option yourself, if that's what you want.)