5
5

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.

capistrano経由でリモート環境でsudo実行する際に躓いた!!

Posted at

Aサーバ:capistranoを導入して
Bサーバ:デプロイ先の環境

この時、僕のアカウント(仮にshinofara)とすると
そのユーザ名とパスワードを設定に書けばいいのだが

set :user,     "shinofara"
set :password, "password"

今回行ったケースとしては

set :user,     "test"
set :password, ""

nopassだった場合。。。
sshで接続してsudo実行するとパスワードきかれちゃうんですよね。。
でも、解決しました。

set :use_sudo, false

を追加することと

デプロイ先の環境で

$ sudo visudo
test ALL=(ALL) NOPASSWD:ALL 

こんな感じで、testユーザに対してsudo権限付与+パスワード認証無しで行けました。!!

※nopassにする場合は、キー認証とかにする方がいいですよ。セキュリティ的に。。。

他に明暗等ありましたら、教えてください。。。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?