16
16

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

MacからSSHでサーバーに自動ログイン

Posted at
  1. MacのTerminal.appを起動しvi等を使ってコピって保存
  2. chmod o+x ./ssh_autologin.sh
  3. ./ssh_autologin.sh で自動ログイン
  4. ネットワークによって遅延が大きい場合、timeoutの数を大きくして調節
ssh_autologin.sh

#!/usr/bin/expect

set timeout 2
spawn ssh ユーザー名@サーバーアドレス -p ポート番号
expect "Password: "
send "パスワード\n"
interact

パスワードを生で保存します。取り扱い注意
鍵認証とかも欲しいなぁ

16
16
2

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
16
16

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?