# Copying files with a mode 400 seems to set to 620 instead

**URL:** <https://forum.ansible.com/t/copying-files-with-a-mode-400-seems-to-set-to-620-instead/19806>\
**Category:** Ansible Project\
**Created:** [November 19, 2015, 11:14am UTC](https://forum.ansible.com/t/copying-files-with-a-mode-400-seems-to-set-to-620-instead/19806 "2015-11-19T11:14:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gary.rutland](https://avatars.discourse-cdn.com/v4/letter/g/59ef9b/32.png) [@gary.rutland](https://forum.ansible.com/u/gary.rutland)\
**Post date:** [November 19, 2015, 11:14am UTC](https://forum.ansible.com/t/copying-files-with-a-mode-400-seems-to-set-to-620-instead/19806/1 "2015-11-19T11:14:05Z")

</div>

Hey,

This is potentially something that is frowned upon, but I’m trying to add SSH keys to a server via Ansible so that the destination server can use these keys later for other operations.

So I am trying to do the following:

`

- name: add default ssh keys  
become: true  
copy:  
src: ./.ssh/  
dest: ~/.ssh  
mode: 400  
force: true  
`

I would expect to see the keys added and set to read only:

`-r--------`

However, when looking at the keys on the destination server I’m seeing this:

`-rw--w----`

Is there any particular reason why they do not have the permissions I’m asking?  
Or is there a way I can upload them and then update all keys in that folder to be read only?

Thanks,  
Gary

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [November 20, 2015, 9:45pm UTC](https://forum.ansible.com/t/copying-files-with-a-mode-400-seems-to-set-to-620-instead/19806/2 "2015-11-20T21:45:37Z")

</div>

Check out the following comment from github:

[https://github.com/ansible/ansible/issues/13159#issuecomment-156482308](https://github.com/ansible/ansible/issues/13159#issuecomment-156482308)

Short answer is that you need to use 0400 instead of 400 so that Ansible knows you are supplying an octal mode as opposed to decimal.
