# Capistrano: chmod 600 database.yml

**URL:** <https://www.ruby-forum.com/t/capistrano-chmod-600-database-yml/136814>\
**Category:** Rails\
**Created:** [May 6, 2008, 4:52pm UTC](https://www.ruby-forum.com/t/capistrano-chmod-600-database-yml/136814 "2008-05-06T16:52:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdaoust](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/dbc845/32.png) [@mdaoust](https://www.ruby-forum.com/u/mdaoust)\
**Post date:** [May 6, 2008, 4:52pm UTC](https://www.ruby-forum.com/t/capistrano-chmod-600-database-yml/136814/1 "2008-05-06T16:52:20Z")

</div>

Would it be wise to chmod 600 your database.yml file using Capistrano  
when deploying seeing as it contains your mysql db in plain text?

~ Mark

---

<div class="post-metadata">

**Author:** ![mdaoust](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/dbc845/32.png) [@mdaoust](https://www.ruby-forum.com/u/mdaoust)\
**Post date:** [May 6, 2008, 5:05pm UTC](https://www.ruby-forum.com/t/capistrano-chmod-600-database-yml/136814/2 "2008-05-06T17:05:50Z")

</div>

On Tue, 6 May 2008, Mark D. wrote:

> Would it be wise to chmod 600 your database.yml file using Capistrano  
> when deploying seeing as it contains your mysql db in plain text?

If your web server software is running under a different user id,  
wouldn’t  
that make it unreadable?

–  
A

---

<div class="post-metadata">

**Author:** ![mdaoust](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/dbc845/32.png) [@mdaoust](https://www.ruby-forum.com/u/mdaoust)\
**Post date:** [May 6, 2008, 5:45pm UTC](https://www.ruby-forum.com/t/capistrano-chmod-600-database-yml/136814/3 "2008-05-06T17:45:15Z")

</div>

Eno wrote:

> If your web server software is running under a different user id,  
> wouldn’t that make it unreadable?

I guess! But couldn’t you just change the ownership of that file to the  
application server process (e.g. mongrel) and then it wouldn’t matter if  
no other users could read it?

---

<div class="post-metadata">

**Author:** ![mdaoust](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/dbc845/32.png) [@mdaoust](https://www.ruby-forum.com/u/mdaoust)\
**Post date:** [May 6, 2008, 6:13pm UTC](https://www.ruby-forum.com/t/capistrano-chmod-600-database-yml/136814/4 "2008-05-06T18:13:03Z")

</div>

On May 6, 11:45 am, Mark D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I guess! But couldn’t you just change the ownership of that file to the  
> application server process (e.g. mongrel) and then it wouldn’t matter if  
> no other users could read it?

Sure, if you have root access you can chown the file but you probably  
won’t have root access on a shared server.
