Created
September 13, 2012 02:03
-
-
Save isann/3711392 to your computer and use it in GitHub Desktop.
teraterm macro パス付き秘密鍵接続・設定ファイル読み込み
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; ------------------------------------- | |
;; TeraTerm ログインスクリプト | |
;; SSHで接続する。 | |
;; ログを取る。 | |
;; ------------------------------------- | |
;; ログインユーザー名(アカウント) | |
;;(自分のユーザー名に合わせて変えてください) | |
strUsername = 'user' | |
strPassword = 'pass' | |
privateKeyFile = '/path/to/key.pem' | |
;; 接続先(ホスト名またはIPアドレス) | |
;;(接続先に合わせて変えてください) | |
strHostname = 'hostname' | |
;; ログファイル | |
logName = "/tmp/teraterm-log/TTM-%Y%m%d-%H%M%S." | |
strconcat logName strHostname | |
strconcat logName ".log" | |
getdate strLogfile logName | |
;; 接続準備 | |
strConnect = strHostname | |
strconcat strConnect ':22 /ssh /auth=publickey /user=' | |
strconcat strConnect strUsername | |
strconcat strConnect ' /passwd=' | |
strconcat strConnect strPassword | |
strconcat strConnect ' /keyfile=' | |
strconcat strConnect privateKeyFile | |
;; 設定ファイル読み込み | |
strconcat strConnect ' /F=/path/to/TERATERM_HONBAN.INI' | |
;; 接続 | |
connect strConnect | |
;; ログを取る | |
logopen strLogfile 1 0 | |
;; 任意コマンド | |
;;wait '# ' | |
;;sendln "alias mysql='mysql -uroot -p -h localhost -D test'" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment