Skip to content

RemoteServerUser

Luca Finzi Contini edited this page Jul 26, 2024 · 4 revisions

Configuring User on the Remote Server

We created the buser user on the backup server. As the default user on an Ubuntu 24.04 server installation, it is a sudoer, so it can sudo to execute privileged commands. But we need a little bit more.

sudo configuration of the buser user on backup

Since our zfs-backup.sh script contains some ssh with sudo commands, we must setup buser on backup server so that it would not require to type its password:

  • execute the command sudo visudo to modify sudo user configuration
  • Add the following line at the very end of the file:
# my user 'buser'
buser   ALL=(ALL) NOPASSWD: ALL
  • Save and exit

Let's check that this works:

user@nas:~$ echo "This is a nice test" | ssh buser@backup sudo tee /root/message.txt
This is a nice test
user@nas:~$ echo "This is a nice test" | ssh buser@backup sudo ls -la /root
total 32
drwx------  4 root root 4096 Jul 21 02:06 .
drwxr-xr-x 23 root root 4096 Jul 21 00:34 ..
-rw-r--r--  1 root root 3106 Apr 22 13:04 .bashrc
-rw-r--r--  1 root root  774 Jul 21 02:00 file.sh
drwxr-xr-x  3 root root 4096 Jul 21 01:48 .local
-rw-r--r--  1 root root   20 Jul 21 02:06 message.txt
-rw-r--r--  1 root root  161 Apr 22 13:04 .profile
drwx------  2 root root 4096 Jul 20 21:38 .ssh
user@nas:~$ echo "This is a nice test" | ssh buser@backup sudo cat /root/message.txt
This is a nice test
user@nas:~$

This is good enough for the Remote Server user buser. Now let's create the ZFS local pool.

Clone this wiki locally