Stack Exchange Network
Stack Exchange network consists of 181 Q&A communities including
Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchange
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this community
Anybody can ask a question
The best answers are voted up and rise to the top
7 years, 6 months ago
the problem is how to automatically transfer backups from server A to server B in the best possible way in terms of security?
Here is what comes to my mind:
authorize server A pub key to access server B
create user on server B only for backups
run ssh-agent on server A, enter password manually after restart
automatically copy files with scp from server A to server B
but if bad person gets access to server A, he will basically have access to server B also. So I have to restrict server B user? How can I do that, and is this the best way of doing this whole backup over network?
Nov 30, 2015 at 10:36
Do not allow server A to have implied
ssh access to server B, nor allow server B to have implied
ssh access to server A. Different passwords. No certificate-based logins. No trust.
rsync as a dæmon on server A such that it offers read only access to the backups, and only from server B. Not over
ssh, but directly.
Have server B copy the backups periodically with
rsync from server A. (Not
ssh, but using the
rsync transport protocol)
Use a VPN or something like
stunnel to protect
rsync traffic between server A and server B.
Jan 16, 2022 at 18:57
104k 14 14 gold badges 130 130 silver badges 252 252 bronze badges
you almost have it. user on server B must be given this will forbid interactive login from server A
/bin/false as shell,
(but file on server B can still be fetched or deleted).
/bin/false as a shell forbid copying
/usr/sbin/nologin also (his account is currently not available.)
A more complex solution would involve
ftps), but this require ssl certificates.
Nov 30, 2015 at 10:58
31k 18 18 gold badges 66 66 silver badges 104 104 bronze badges
I suggest a
scp to copy files.
Write a shellscript
backupToServer.sh, which tars your files-to-backup and then puts them on the server with
scp /path/to/backup/tar user@server:/path/where/backup/is/stored. make usage of
You can use
date or similar tools to name your backup correctly.
crontab -e you add a new
cronjob. Take a look at the time settings of
crontab, they are rather trivial but look weird on first sight.
Nov 30, 2015 at 11:16
101 3 3 bronze badges
log in to answer this question.
Not the answer you're looking for? Browse other questions tagged
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our
Accept all cookies
Necessary cookies only