I backup all files from first server and restore it in second server. But now I can't enter to my second server, because ssh configs overrode from first server. What files and directories I need to exclude from backup to restore files and enter in my second server with previous login and passwords? /etc/ssh, what else?

1 Answer 1


As you say, /etc/ssh will contain the config and host keys (but a change in host keys will usually "only" give you the annoying fingerprint warning again);

  • you probably also want all users' ~/.ssh directories, in particular authorized_keys if you use public/private keypair authentication;

  • if you use password authentication (and don't have centralized auth like LDAP, Kerberos, etc.), you need to consider /etc/shadow, which contains the password hashes for every user.

  • Yes, I use password authentication. Do I understand correctly that I can not add this file to an exclusion, because other users will not be created during the restore (mysql for example). Then I have to manually create users, right?
    – Log
    Dec 2, 2017 at 16:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .