← 返回命令列表

Linux command

plink 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Connect to SSH server

plink [user]@[host]

Execute remote command

plink [user]@[host] [command]

Use specific port

plink -P [port] [user]@[host]

Use private key

plink -i [key.ppk] [user]@[host]

SSH tunnel

plink -L [local_port]:[remote_host]:[remote_port] [user]@[host]

说明

plink is the command-line SSH connection tool from the PuTTY suite. It provides non-interactive SSH access for executing remote commands, port forwarding, and scripted SSH operations. Unlike the interactive PuTTY terminal, plink is designed for automation and batch operations. It supports SSH key authentication using PuTTY's .ppk key format. The -batch flag disables all interactive prompts, making it suitable for scripts and cron jobs.

参数

-ssh, -telnet, -rlogin, -raw, -serial
Force use of a specific protocol.
-P _PORT_
Connect to the specified port.
-l _USER_
Login username.
-pw _PASSWORD_
Login with the given password (insecure; prefer -pwfile).
-pwfile _FILE_
Read password from file.
-i _KEY_
Private key file for authentication (.ppk format).
-load _SESSION_
Load settings from a saved PuTTY session.
-L _bindaddr_:_port_:_host_:_hostport_
Forward local port to remote destination.
-R _bindaddr_:_port_:_host_:_hostport_
Forward remote port to local destination.
-D _bindaddr_:_port_
Dynamic SOCKS-based local port forwarding.
-N
Don't start a shell or command (SSH-2 only).
-T, -t
Disable/enable pseudo-terminal allocation.
-A, -a
Enable/disable agent forwarding.
-X, -x
Enable/disable X11 forwarding.
-m _FILE_
Read remote command(s) from file.
-batch
Disable all interactive prompts.
-v
Verbose output.
--help
Display help.

FAQ

What is the plink command used for?

plink is the command-line SSH connection tool from the PuTTY suite. It provides non-interactive SSH access for executing remote commands, port forwarding, and scripted SSH operations. Unlike the interactive PuTTY terminal, plink is designed for automation and batch operations. It supports SSH key authentication using PuTTY's .ppk key format. The -batch flag disables all interactive prompts, making it suitable for scripts and cron jobs.

How do I run a basic plink example?

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

What does -ssh, -telnet, -rlogin, -raw, -serial do in plink?

Force use of a specific protocol.