← 返回命令列表

Linux command

putty 命令

网络

需要网络或远程资源。

常用示例

Connect to SSH server

putty -ssh [user@host]

Connect with specific port

putty -ssh -P [2222] [user@host]

Load saved session

putty -load "[session_name]"

Connect via serial

putty -serial [/dev/ttyUSB0]

Use private key

putty -ssh -i [key.ppk] [user@host]

说明

PuTTY is a free terminal emulator and network file transfer application supporting SSH, Telnet, SCP, and serial connections. Originally developed for Windows where no built-in SSH client existed, it has become one of the most widely used remote access tools and is also available on Linux and macOS. PuTTY stores connection profiles as saved sessions, allowing quick access to frequently used servers with preconfigured settings for port, protocol, key authentication, and terminal appearance. It uses its own PPK key format, though keys can be converted to and from OpenSSH format using the companion puttygen tool. The PuTTY suite includes plink for command-line connections, pscp and psftp for file transfer, and pageant for SSH agent key management.

参数

-ssh
Use the SSH protocol.
-telnet
Use the Telnet protocol.
-serial
Open a serial connection.
-raw
Use raw TCP (no protocol-level processing).
-rlogin
Use the Rlogin protocol.
-l _USER_
Specify login username.
-pw _PASSWORD_
Provide password on the command line (insecure; prefer -pwfile).
-pwfile _FILE_
Read password from the first line of _FILE_.
-P _PORT_
Port number.
-i _KEY_
Private key file (PPK format).
-load _SESSION_
Load a saved session by name.
-X / -x
Enable / disable X11 forwarding.
-A / -a
Enable / disable agent forwarding.
-C
Enable compression.
-L _local:host:port_
Forward a local port to a remote destination.
-R _remote:host:port_
Forward a remote port back to the local machine.
-D _port_
Open a SOCKS dynamic-port-forwarding listener.
-m _FILE_
Execute the contents of _FILE_ on the remote host instead of an interactive shell.
-N
Do not start a shell or command (useful for port-forwarding only).
-nc _host:port_
Make a TCP connection through the SSH server instead of a shell.
-t / -T
Force / suppress pseudo-terminal allocation.
-agent / -noagent
Enable / disable Pageant authentication.

FAQ

What is the putty command used for?

PuTTY is a free terminal emulator and network file transfer application supporting SSH, Telnet, SCP, and serial connections. Originally developed for Windows where no built-in SSH client existed, it has become one of the most widely used remote access tools and is also available on Linux and macOS. PuTTY stores connection profiles as saved sessions, allowing quick access to frequently used servers with preconfigured settings for port, protocol, key authentication, and terminal appearance. It uses its own PPK key format, though keys can be converted to and from OpenSSH format using the companion puttygen tool. The PuTTY suite includes plink for command-line connections, pscp and psftp for file transfer, and pageant for SSH agent key management.

How do I run a basic putty example?

Run `putty -ssh [user@host]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -ssh do in putty?

Use the SSH protocol.