#2898 Issue closed: How to configure remote user other than root?

Labels: support / question, fixed / solved / done, external tool

ZENAdmin-Ops opened issue at 2022-12-23 06:24:

Relax-and-Recover (ReaR) Issue Template

Fill in the following items before submitting a new issue
(quick response is not guaranteed with free support):

  • ReaR version ("/usr/sbin/rear -V"): 2.6

  • OS version ("cat /etc/os-release" or "lsb_release -a" or "cat /etc/rear/os.conf"): Ubuntu 22.04

  • ReaR configuration files ("cat /etc/rear/site.conf" and/or "cat /etc/rear/local.conf"):

this_file_name=$( basename ${BASH_SOURCE[0]} )
LOGFILE="$LOG_DIR/rear-$HOSTNAME-$WORKFLOW-${this_file_name%.*}.log"

BACKUP=BORG
BORGBACKUP_HOST="some.fqdn"
BORGBACKUP_USERNAME="zen"
BORGBACKUP_ARCHIVE_PREFIX="BorgArchive"

# BORGBACKUP_UMASK="0002"
BACKUP_ONLY_INCLUDE="yes"
BACKUP_PROG_INCLUDE=( '/home/' )

BORGBACKUP_PRUNE_KEEP_DAILY=7
BORGBACKUP_PRUNE_KEEP_WEEKLY=5
BORGBACKUP_PRUNE_KEEP_MONTHLY=13
BORGBACKUP_PRUNE_KEEP_HOURLY=24
BORGBACKUP_PRUNE_KEEP_YEARLY=2
BORGBACKUP_COMPRESSION="zlib,9"
BORGBACKUP_ENC_TYPE="keyfile"

COPY_AS_IS_BORG=( "$ROOT_HOME_DIR/.config/borg/keys/" )
export BORG_KEYS_DIR=( "$ROOT_HOME_DIR/.config/borg/keys/" )

export BORG_PASSPHRASE='some key'
export BORG_RELOCATED_REPO_ACCESS_IS_OK="yes"
export BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK="yes"
  • Hardware vendor/product (PC or PowerNV BareMetal or ARM) or VM (KVM guest or PowerVM LPAR):

  • System architecture (x86 compatible or PPC64/PPC64LE or what exact ARM device):

  • Firmware (BIOS or UEFI or Open Firmware) and bootloader (GRUB or ELILO or Petitboot):

  • Storage (local disk or SSD) and/or SAN (FC or iSCSI or FCoE) and/or multipath (DM or NVMe):

  • Storage layout ("lsblk -ipo NAME,KNAME,PKNAME,TRAN,TYPE,FSTYPE,LABEL,SIZE,MOUNTPOINT"):

  • Description of the issue (ideally so that others can reproduce it):
    I've been running an off-site Borg backup, that has been working, and connecting as root on the remote host.

Recently I encountered permissions issue with accessing the repository on the remote host and after doing some troubleshooting I've been advised that running as root on the remote host, rather than some other user is not best practice and is likely going to periodically lead to issues like the permissions issue which I have recently experienced.

So, I have reconfigured the remote host to use a user other than root.

And I can ssh to the remote host, using the non-root user (zen).

However, when I modify the conf file and specify the user: zen
BORGBACKUP_USERNAME="zen"

So, to be clear, previously I had the BORGBACKUP_USERNAME commented out and the backup was working connecting as root.

But I no longer wish to connect as root, but the BORGBAKUP_USERNAME is being ignored.

I've also tried prepending the username to the BORGBACKUP_HOST, but this doesn't work either.

The rear logs show that the username is being ignored and that rear is still connecting as root

  • Workaround, if any:

  • Attachments, as applicable ("rear -D mkrescue/mkbackup/recover" debug log files):
    Rear log attached

To paste verbatim text like command output or file content,
include it between a leading and a closing line of three backticks like

```
verbatim content
```

rear-Ubuntu-DR6.8691.log

ZENAdmin-Ops commented at 2022-12-23 06:29:

I know that I had some issues with performing Borg backups with rear previously and we ended up modifying one of the rear bash scripts as a work-around.

Perhaps that is the reason that the username is being ignored here. I will try to find my notes about this earlier ticket

ZENAdmin-Ops commented at 2022-12-23 06:36:

That mod to rear bash script was the reason.

My memory is hopeless.

This is resolved.

Sorry

jsmeix commented at 2023-01-02 10:31:

I am not a Borg backup user so I cannot actually help with
Borg backup specific issues.
As far as I see this issue seems to be related to
https://github.com/rear/rear/issues/2845


[Export of Github issue for rear/rear.]