# Confused about backing up keys and account credentials

**URL:** <https://community.letsencrypt.org/t/confused-about-backing-up-keys-and-account-credentials/12483>\
**Category:** Uncategorized\
**Created:** [March 14, 2016, 12:27am UTC](https://community.letsencrypt.org/t/confused-about-backing-up-keys-and-account-credentials/12483 "2016-03-14T00:27:01Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![sahsanu](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/sahsanu/32/89984_2.png) [@sahsanu](https://community.letsencrypt.org/u/sahsanu)\
**Post date:** [March 14, 2016, 1:08am UTC](https://community.letsencrypt.org/t/confused-about-backing-up-keys-and-account-credentials/12483/2 "2016-03-14T01:08:42Z")

</div>

Hello @letsyoyo,

> [@letsyoyo](#):
>
> I see that live/example.com contains 4 .pem files. I thought I would back this up locally but I can't even copy it to my user account temporarily:sudo cp live/example.com/_.pem ~myusercp: cannot stat ‘live/example.com/_.pem’: No such file or directory

Keep in mind that those 4 pem files inside ` live/example.com` dir are not regular files but symbolic links pointing to the real pem files located in `archive/example.com`

Example listing `live/example.com` dir:

```
$ sudo ls -l /etc/letsencrypt/live/example.com/
total 0
lrwxrwxrwx 1 root root 35 Mar 14 01:47 cert.pem -> ../../archive/example.com/cert1.pem
lrwxrwxrwx 1 root root 36 Mar 14 01:47 chain.pem -> ../../archive/example.com/chain1.pem
lrwxrwxrwx 1 root root 40 Mar 14 01:47 fullchain.pem -> ../../archive/example.com/fullchain1.pem
lrwxrwxrwx 1 root root 38 Mar 14 01:47 privkey.pem -> ../../archive/example.com/privkey1.pem

```

> [@letsyoyo](#):
>
> sudo cp live/example.com/_.pem ~myusercp: cannot stat ‘live/example.com/_.pem’: No such file or directory

You user has no rights to access `/etc/letsencrypt/live/example.com/` (that is the reason you are using sudo, right?)... well, keep in mind that shell is trying to expand \*.pem before executing sudo, that means that the shell is trying to get the file names matching the pattern \*.pem before it has the rights to read the contents of that dir so as the shell can't expand the pattern \*.pem it is passed literally to sudo and when cp is executed by sudo it cannot find a file named \*.pem, that is the reason for the cannot stat error.

So, if you want to copy the contents of `live/example.com`, copy the entire dir and use -L switch to copy the real files instead of the symbolic links

`sudo cp -rL /etc/letsencrypt/live/example.com/ ~myuser`

If you still want to use the \*.pem pattern you should execute it inside a shell launched by sudo:

`sudo sh -c 'cp -L /etc/letsencrypt/live/example.com/*.pem ~myuser'`

Maybe a better approach is just copy the archive dir that is where your real pem files are located.

`sudo cp -r /etc/letsencrypt/archive/example.com/ ~myuser`

But **the best approach is backup the entire** `/etc/letsencrypt` dir. There you have not only the certs, the keys used for those certs, etc. but the renewal info, your account details used to revoke certs, etc. so yes, please, backup all.

`sudo cp -r /etc/letsencrypt/ ~myuser`

Edit: If you copy the files, the owner of that files will be root, if you want to view the contents using your user you should chown the copied dir.

`sudo chown -R myuser:myuser ~myuser/letsencrypt/`

Cheers,  
sahsanu

---

_[View the full topic](https://community.letsencrypt.org/t/confused-about-backing-up-keys-and-account-credentials/12483)._
