LoginSignup
1
2

More than 3 years have passed since last update.

Teratermで自動SSHログインするためにとりあえずttlファイルにこれを書く

Posted at

TeraTermでLinuxサーバにログインするときに聞かれるユーザー名とパスワードを、いちいち入力することが面倒な時は、自動ログインマクロを作っておくと楽です。

以下、SSHでログインする場合のソースを置きましたので、コピー&ペースト後、username,hostname,passwordを各々書き込んで、「ttlファイル」に保存してご利用ください。

鍵が必要であったり、プロキシを通過するようなケースですと、別個編集が必要となります。

username = '' #ログインユーザー名
hostname = '' #ホスト名(IPアドレスの場合が多い)
password = '' #ログインパスワード

msg = hostname
strconcat msg ':22 /ssh /2 /auth=password /user='
strconcat msg username
strconcat msg ' /passwd='
strconcat msg password
connect msg
1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2