3
2

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.

Ansible でサーバに接続できないのメモ

Last updated at Posted at 2016-01-06

体裁は後で整えるとしてメモ。追記も随時。

事例1

ansible で -m ping でもエラーになる(特にはじめてのサーバ)


エラーメッセージ
ssh connection closed waiting for a privilege escalation password prompt

悩みに悩んだ挙句、対象のサーバがパスワードログインを禁止に設定してあることに気づく。
正しい対処方法はよくわからないが、ssh で接続しているので、 ansible.cfg に


ssh_args = -F ssh_config -q -o PubkeyAuthentication=yes

として、鍵認証でログインすれば通過できた。
てかなんでデフォルトで鍵認証オフなんだ。。。
(ちなみに Ansible のバージョンは1.9.3)

事例2

これも特にはじめてのサーバの時


エラーメッセージ
fatal: [act-sandbox00] => Incorrect become password

パスワード誤り。初期パスワードのままになっててsudoできないとか。

事例3

これも(ry


エラーメッセージ
ssh connection closed waiting for sudo password prompt

sudo 出来ない可能性。 sudoersに追加されてないとか。 %wheel が有効じゃないとか。


$ visudo
## Allows people in group wheel to run all commands
# %wheel        ALL=(ALL)       ALL
↓
%wheel        ALL=(ALL)       ALL

あと

Defaults    requiretty
↓
# Defaults    requiretty
3
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
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?