plink是putty套件中的一个工具。大家应该都很熟悉putty的工作方式,就是先通过填写用户名和密码登录到远程的Unix系统上,然后再交互式对远程机器进行操作。和putty不同,plink提供了一种非交互的使用模式。使用时,用户名和密码被包含在参数中,直接执行用户需要的操作。
-
C:\Program Files\putty>plink
-
PuTTY Link: command-line connection utility
-
Release 0.63
-
Usage: plink [options] [user@]host [command]
-
("host" can also be a PuTTY saved session name)
-
Options:
-
-V print version information and exit
-
-pgpfp print PGP key fingerprints and exit
-
-v show verbose messages
-
-load sessname Load settings from saved session
-
-ssh -telnet -rlogin -raw -serial
-
force use of a particular protocol
-
-P port connect to specified port
-
-l user connect with specified username
-
-batch disable all interactive prompts
-
The following options only apply to SSH connections:
-
-pw passw login with specified password
-
-D [listen-IP:]listen-port
-
Dynamic SOCKS-based port forwarding
-
-L [listen-IP:]listen-port:host:port
-
Forward local port to remote address
-
-R [listen-IP:]listen-port:host:port
-
Forward remote port to local address
-
-X -x enable / disable X11 forwarding
-
-A -a enable / disable agent forwarding
-
-t -T enable / disable pty allocation
-
-1 -2 force use of particular protocol version
-
-4 -6 force use of IPv4 or IPv6
-
-C enable compression
-
-i key private key file for authentication
-
-noagent disable use of Pageant
-
-agent enable use of Pageant
-
-m file read remote command(s) from file
-
-s remote command is an SSH subsystem (SSH-2 only)
-
-N don
介绍下常用参数:
-P 指定服务器端口,这里是大写P;
-l 指定以哪个用户身份执行命令;
-pw 指定用户密码;
-i keyfile指定私钥文件;
-m file如果需要执行的命令比较多,可以将命令保存到一个文件,通过-m参数指定文件.
下面是一个小例子,在DOS下查询远程机器的时间
-
C:\Users\linghzha\Program Files\putty>PLINK.EXE -l root -pw password 192.168.0.23 date
-
Mon Dec 2 14:04:13 CST 2013
详细的介绍,参考官方文档:
阅读(3127) | 评论(0) | 转发(0) |