Rails one-click application restart server without password

Posted December 10, 2017 2.7k views
Linux BasicsDigitalOcean 1-Click Apps MarketplaceUbuntu 16.04

Hello, I’m trying to setup automatic deploy with capistrano for one-click rails application.

I have a rails user which I added to sudo group.

The problem is, that when I want to restart the application using systemctl restart unicorn I need to provide a password - I would like to bypass that, so if I am logged in as proper user, the password won’t be required again. This would restart my serwer without need to log in each time I make changes in the application.

Could you help me with that?

But also maybe there is better way to do that? Could you please give me some advise?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

There’s an option in sudoers that allows the user to sudo without password - NOPASSWD