pschiffe / docker-borg

Docker image with BorgBackup client utility and sshfs support
https://hub.docker.com/r/pschiffe/borg/
MIT License
51 stars 18 forks source link

SSH authentication failed #28

Open ringge opened 5 days ago

ringge commented 5 days ago

Hello, I'm using below command. However, usually outside of docker-borg, I need to provide export BORG_RSH='ssh -i /home/user/.ssh/id_rsa_borg' so that the ssh connection is authenticated. How do I provide BORG_RSH in this case? Many thanks docker run \ -e BORG_REPO='user@hostname:/path/to/repo' \ -e ARCHIVE=wordpress-$(date +%Y-%m-%d) \ -e BORG_PASSPHRASE=my-secret-pw \ -e BACKUP_DIRS=/borg/data \ -e COMPRESSION=lz4 \ -e PRUNE=1 \ -v borg-config:/root \ -v mariadb-data:/borg/data/mariadb:ro \ -v wordpress-data:/borg/data/wordpress:ro \ --name borg-backup \ pschiffe/borg

pschiffe commented 4 days ago

Hello, you can specify any borg's env var via -e BORG_RSH='ssh -i /home/user/.ssh/id_rsa_borg', however, make sure the file is available inside of the container, ssh key should be placed in the borg-config volume, path /root inside of the container.

ringge commented 4 days ago

Hi, thanks for your reply. I tried that but it didn't work, turns out in addition to id_rsa file, I also need to create a known_hosts file in borg-config volume.

pschiffe commented 3 days ago

yeah, that's ideal for security to protect against mitm attack