# How to restrict access to my deploy.rb file?

**URL:** <https://www.ruby-forum.com/t/how-to-restrict-access-to-my-deploy-rb-file/153160>\
**Category:** Deployment\
**Created:** [November 12, 2008, 8:11pm UTC](https://www.ruby-forum.com/t/how-to-restrict-access-to-my-deploy-rb-file/153160 "2008-11-12T20:11:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rgagnon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e95f7d/32.png) [@rgagnon](https://www.ruby-forum.com/u/rgagnon)\
**Post date:** [November 12, 2008, 8:11pm UTC](https://www.ruby-forum.com/t/how-to-restrict-access-to-my-deploy-rb-file/153160/1 "2008-11-12T20:11:29Z")

</div>

I would like to restrict the access to the deploy.rb file to prevent any  
mods from anybody that could cause major issue in production zone for  
instance.

I do know that I can keep the deploy.rb any from the project. I’d like  
to know some real world process for this.

Thank you

RÃ©mi

---

<div class="post-metadata">

**Author:** ![rgagnon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e95f7d/32.png) [@rgagnon](https://www.ruby-forum.com/u/rgagnon)\
**Post date:** [December 14, 2008, 8:56pm UTC](https://www.ruby-forum.com/t/how-to-restrict-access-to-my-deploy-rb-file/153160/2 "2008-12-14T20:56:49Z")

</div>

RÃ©mi Gagnon wrote:

> I would like to restrict the access to the deploy.rb file to prevent any  
> mods from anybody that could cause major issue in production zone for  
> instance.
> 
> I do know that I can keep the deploy.rb any from the project. I’d like  
> to know some real world process for this.
> 
> Thank you
> 
> RÃ©mi

I recommend having the deploy script prompt for passwords (SSH, SVN/Git,  
etc) instead of baking them in in plain text. That way the script is  
useless without credentials.

---

<div class="post-metadata">

**Author:** ![rgagnon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e95f7d/32.png) [@rgagnon](https://www.ruby-forum.com/u/rgagnon)\
**Post date:** [December 14, 2008, 10:08pm UTC](https://www.ruby-forum.com/t/how-to-restrict-access-to-my-deploy-rb-file/153160/3 "2008-12-14T22:08:59Z")

</div>

Jeremy Weiskotten wrote:

> RÃ©mi Gagnon wrote:
> 
> > I would like to restrict the access to the deploy.rb file to prevent any  
> > mods from anybody that could cause major issue in production zone for  
> > instance.
> 
> I recommend having the deploy script prompt for passwords (SSH, SVN/Git,  
> etc) instead of baking them in in plain text. That way the script is  
> useless without credentials.

+1. Additional things that you can undertake:

- Use SSH keys. The best security model relies on something that you  
know (credentials) plus something that you have (private keys).

- Keep a deploy.example.rb file under source control and set the actual  
deploy.rb to ignore. This is not a substitute for prompting passwords!  
You can use it to add a layer of obscurity for your repository URL and  
server hostnames.

–  
Roderick van Domburg  
[http://www.nedforce.com](http://www.nedforce.com)
