LoginSignup
1
2

More than 5 years have passed since last update.

サーバにsshするときにパスワードをコマンドのオプションで渡したい

Posted at

概要

これはなに?

  • sshpass

- sshでインタラクティブに入力する項目を引数でわたせる

目標

  • bison-3.0.4 の実行ファイルが使用可能になる

実行環境

依存パッケージ

  • なし

導入手順

epelリポジトリ追加

sudo rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

yum でインストールする

sudo yum install sshpass

使ってみる

sshpass -p '(パスワード)' ssh -l boscoworks 192.168.56.101

感想

  • 日常的にこれを使うのは良くないなぁ。bash_historyにパスワードが平文で残ってしまう
  • 鍵とかパスワードとかが設定できないサーバに対してスクリプトで処理を行うときに最終手段として使う感じ
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