sshpassが見つからない CentOS

openssh-clientsが必要なので、インストールしたらエラー。

なので、以下の手順でインストール

1.yum install -y epel

 epel入れた後、openssh-clientsインストールしようとしたら、エラーになる。
 epelのレポジトリ更新されて変になるみたい。

2.レポジトリ(/etc/yum.repos.d/epel.repo)の設定をmirrorからbaseurlに変更。
 今度はこんなメッセージ。
 [Errno 14] Peer cert cannot be verified or peer cert invalid

 証明書が認証できないってなるので、証明書更新。
 yum upgrade ca-certificates --disablerepo=epel


3.yum install -y sshpass

これで完了。
無事使えるようになった。

ちなみにsshで自動パスワード入力は、sshpassで指定する。
sshpass -p 'password' scp -o StrictHostKeyChecking=no user@remotehost:remotefile localfile >> logfile 2>&1

こんな感じ。ログファイル出力不要ならリダイレクトなしでOK。





コメント

このブログの人気の投稿

Spring boot STS 日本語化