(PuTTYユーザマニュアル) 7.2 Plinkを使う - 7.2 Using Plink
http://the.earth.li/~sgtatham/putty/0.60/htmldoc/Chapter7.html#plink-startingの日本語訳。
新年早々何をやっているのやら・・・・。<< 7.1 Plinkを始める - 目次に戻る - 7.3 バッチファイルやスクリプトでPlinkを使う >>
訳文
この節は対話ログインや自動化された処理でのPlinkの使い方の基本を記述します。
This section describes the basics of how to use Plink for interactive logins and for automated processes.
入力するためのコンソールウィンドウの起動後、plinkとだけ入力すれば使い方のメッセージが表示されます。これを見ると、使用しているPlinkのバージョンとPlinkの使い方の概要がわかります。
Once you've got a console window to type into, you can just type plink on its own to bring up a usage message. This tells you the version of Plink you're using, and gives you a brief summary of how to use Plink:
Z:\sysosd>plink PuTTY Link: command-line connection utility Release 0.60 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 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't start a shell/command (SSH-2 only) -nc host:port open tunnel in place of session (SSH-2 only)
ここまでできれば、Plinkを使う準備はできています。
Once this works, you are ready to use Plink.
7.2.1 対話ログインにPlinkを使う - 7.2.1 Using Plink for interactive logins
リモートサーバへの単純な対話型の接続を確立するには、plinkにつづけてホスト名を入力します。
To make a simple interactive connection to a remote server, just type plink and then the host name:
Z:\sysosd>plink login.example.com Debian GNU/Linux 2.2 flunky.example.com flunky login:
普通にログインするとセッションが起動されるはずです。サーバが期待するような端末制御コードへの割り込みはほとんどされず、サーバからの出力はコマンドプロンプトウィンドウに直接書き込まれます。したがって、たとえば、全画面アプリケーションを起動している場合、ウィンドウには奇妙な文字が現れることが予想できます。このような対話型の接続はPlinkの要点ではありません。
You should then be able to log in as normal and run a session. The output sent by the server will be written straight to your command prompt window, which will most likely not interpret terminal control codes in the way the server expects it to. So if you run any full-screen applications, for example, you can expect to see strange characters appearing in your window. Interactive connections like this are not the main point of Plink.
様々なプロトコルで接続するために、コマンドラインオプション-ssh、-telnet、-rloginや-rawを指定できます。SSH接続を確立するためには、例えば:
In order to connect with a different protocol, you can give the command line options -ssh, -telnet, -rlogin or -raw. To make an SSH connection, for example:
Z:\sysosd>plink -ssh login.example.com login as:
すでにPuTTY保存セッションを設定している場合、ホスト名を指定する代わりに、保存セッションの名前を指定できます。これにより公開キー認証を仕様やユーザ名を指定、その他のPuTTYの多くの機能を使うことができるようになります。
If you have already set up a PuTTY saved session, then instead of supplying a host name, you can give the saved session name. This allows you to use public-key authentication, specify a user name, and use most of the other features of PuTTY:
Z:\sysosd>plink my-ssh-session Sent username "fred" Authenticating with public key "fred@winbox" Last login: Thu Dec 6 19:25:33 2001 from :0.0 fred@flunky:~$