-
Notifications
You must be signed in to change notification settings - Fork 0
RemoteServerUser
Luca Finzi Contini edited this page Jul 26, 2024
·
4 revisions
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.
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 visudoto modifysudouser 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.
ZFS Backup, (c) 2024 Luca Finzi Contini - Use it at your own risk but enjoy doing so :)