Help using Backup & Restore Utility with Linux

Backup and data protection discussion at its finest.

Moderator: Lillian.W@AST

User avatar
Nazar78
Posts: 2003
youtube meble na wymiar Warszawa
Joined: Wed Jul 17, 2019 10:21 pm
Location: Singapore
Contact:

Re: Help using Backup & Restore Utility with Linux

Post by Nazar78 »

dmtparker wrote:I'm confused. See comments below.
Nazar78 wrote:Your network seems to be correct judging from the subnet /24.

Your last command is incomplete:

Code: Select all

netstat -natp|grep -E ':(21|873) '
I ran the above (copy and paste so no typo) and got no results (just '>' which I eventually terminated with ^C)
You are missing the last single quote before you press enter hence the need for ^C as that command is waiting for the next line. Doesn't matter anyway because we know both rsyncd and vsftpd was not installed earlier.
dmtparker wrote:I am sure I can get both up and working over the next day or two, but I'm again confused as to which is server and which is client. I would think the NAS would be server and my linux box client as I am trying to back up the linux box onto the NAS, but it looks like setting up rsyncd is to make the box a server?? As I said, ftp (run on the linux box) connects to the NAS just fine and transfers files fine, it is just not an automated process.
Server or client depends on which end initiating the transfer process and which endpoint is the receiver that usually runs the listening server daemon (D in rysncD/vsftpD stands for daemon). In this case you planned to use Asustor Backup & Restore Utility so the NAS is the client and the linux box is the server running the daemon. You can also switch this process the other way round but you'll have to install some backup apps on the linux box to initiate the transfer and the NAS needs to run the ftp or rsync daemon (enable them in the Asustor Portal Services).
dmtparker wrote:Ok, I think I have both rsyncd and vsftpd up and running. I tried
CODE: SELECT ALL
rsync-rtn rsync://192.168.1.3
and got the listing of the two modules I had defined. When I tried to list the contents of the module, however, it failed as shown below. I am sure that relates to my defining who has access in the 'secrets' file. I put in my account and password and the root account and password, but how do I define the remote computer trying to log in? It didn't ask for a username, just a passsword
Take note rsync has two modes, one is unencrypted faster transfer which is rsync protocol (similar to ftp/http), the other is slightly slower transfer due to encryption overhead using SSH tunnel. Here is for rsync protocol. There's 3 ways to use the user/pass below assuming your linux box IP is 192.168.1.3:

1. Environment

Code: Select all

RSYNC_PASSWORD="my-password" rsync -rtn rsync://mark@192.168.1.3/mark
2. Password file

Code: Select all

rsync -rtn --password-file=~/my-password-file rsync://mark@192.168.1.3/mark
3. Process substitution

Code: Select all

rsync -rtn --password-file=<(echo "my-password") rsync://mark@192.168.1.3/mark
Avoid method 1 and 3 if you're on shared or production environment as anyone can see the password. For method 2, chmod 0600 ~/my-password-file to make it not readable to others. Refer here for details https://linux.die.net/man/1/rsync
dmtparker wrote:Also, how do I test vsftpd? And how does all this help me with the Backup Utility? What do I do next?
Thanks 10^6 for all the help.
Skip the testing vsftpd. I figured that out. It appears both are up and listening on the appropriate port. Now what do I do to use the Backup Utility?
Now open the Asustor's Backup & Restore utility, choose Remote Sync, click on Create, Server type: Rsync-compatible server, Transfer mode: Rsync-compatible server -> Your NAS, click Next and enter your linux box details (do not check the box Use encrypted transmission because you want to perform rsync not rsync over ssh tunnel), select the source folders on your linux box (the modules you've created earlier) then click Next, select the destination folder on your NAS. That's it, it's the same for vsftpd only that you'ld chose the FTP Backup option.
Screenshot 2021-08-07 161609.png
Screenshot 2021-08-07 161609.png (1.45 MiB) Viewed 3777 times
AS5304T - 16GB DDR4 - ADM-OS modded on 2GB RAM
Internal:
- 4x10TB Toshiba RAID10 Ext4-Journal=Off
External 5 Bay USB3:
- 4x2TB Seagate modded RAID0 Btrfs-Compression
- 480GB Intel SSD for modded dm-cache (initramfs auto update patch) and Apps

When posting, consider checking the box "Notify me when a reply is posted" to get faster response
dmtparker
Posts: 27
Joined: Wed Aug 04, 2021 10:56 pm

Re: Help using Backup & Restore Utility with Linux

Post by dmtparker »

I'm obviously doing something wrong. When I set up rsyncd following the tutorial, I created the file etc/rsyncd.secrets as instructed. In it I put 3 user:password lines, my user on linux box, my user on NAS, and root.
Following your instructionis, I get:
Screenshot-4.png
Screenshot-4.png (74.4 KiB) Viewed 3772 times
Note I did swap "my-password" for my real password when I ran it, but changed it back just for purposes of posting here.

I also tried setting up Backup Utility on NAS using first my user on NAS and then my user on Linux box, but got the same result: it hangs trying to connect:
Screenshot-5.png
Screenshot-5.png (158.97 KiB) Viewed 3772 times
User avatar
Nazar78
Posts: 2003
Joined: Wed Jul 17, 2019 10:21 pm
Location: Singapore
Contact:

Re: Help using Backup & Restore Utility with Linux

Post by Nazar78 »

For your first command is correct only resulted in wrong authentication.

For your second command onwards, your usage of the /etc/rsyncd.secrets is misinterpreted. Don't be confused between the client and server. This "/etc/rsyncd.secrets" is the secret file on the rsync daemon server containing list of "user:password" separated by lines. But when you execute the command as client, the "--password-file=" containing only the "password" in a single line should be a separate file stored in e.g. your home path --password-file=/home/mark/my-rsync-passwords.txt. This file needs 0600 permission.

Obviously you need to fix the authentication issue before using the rsync protocol with the backup & restore utility. You can just run:

Code: Select all

rsync -rtn rsync://mark@192.168.1.3/mark
where it should prompt you for password and if the password you input is still wrong, then please share your rsyncd config "/etc/rsyncd.conf" (you'll need to restart rsyncd if this file is edited) and the "/etc/rsyncd.secrets" (mask off your actual passwords or use a fake one, this file needs 0640 permission) from the linux box.
AS5304T - 16GB DDR4 - ADM-OS modded on 2GB RAM
Internal:
- 4x10TB Toshiba RAID10 Ext4-Journal=Off
External 5 Bay USB3:
- 4x2TB Seagate modded RAID0 Btrfs-Compression
- 480GB Intel SSD for modded dm-cache (initramfs auto update patch) and Apps

When posting, consider checking the box "Notify me when a reply is posted" to get faster response
dmtparker
Posts: 27
Joined: Wed Aug 04, 2021 10:56 pm

Re: Help using Backup & Restore Utility with Linux

Post by dmtparker »

Still having problems. I created the my-rsync-passwords.txt with feather pad then saved it and changed permission to 600, then ran commands as shown. Note I forgot to run the "password file=" at first, but did later. I can change owner to root as it requested, but that seems wrong for a file in my local directory??
Screenshot-6.png
Screenshot-6.png (64.6 KiB) Viewed 3765 times
Cannot attach a conf file. It reads:
motd file = /etc/rsyncd.motd
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock

[mark]
path = /home/mark
comment = mark
uid = nobody
gid = nobody
read only = no
list = yes
auth users = rsync1
secrets file = /etc/rsyncd.secrets

[T2]
path = /media/mark/T2/
comment = T2
uid = nobody
gid = nobody
read only = no
list = yes
auth users = rsync1
secrets file = /etc/rsyncd.secrets

Do I need to change "auth users"??


The secrets file is:
dmtparker:xxxxx (this is user on NAS)
root:xxxxx
mark:xxxxxxx (this is user on Linux box)
User avatar
Nazar78
Posts: 2003
Joined: Wed Jul 17, 2019 10:21 pm
Location: Singapore
Contact:

Re: Help using Backup & Restore Utility with Linux

Post by Nazar78 »

You're almost there :)

You don't have to change the owner to root. It says that because you ran with sudo as root so it thinks you're root. Change back the owner to mark and just run without sudo.

Code: Select all

auth users = rsync1
Do I need to change "auth users"??
Yes change this to mark. It's the list of users separated by spaces who has access to this module mark. Then restart the rsyncd and retry. How to restart you may ask, assuming you followed that guide, do a "sudo killall rsync; sudo rsync --daemon". Your last task is to make this rsync daemon permanently auto start on boot on your linux box. I'll let you do this by yourself :p
AS5304T - 16GB DDR4 - ADM-OS modded on 2GB RAM
Internal:
- 4x10TB Toshiba RAID10 Ext4-Journal=Off
External 5 Bay USB3:
- 4x2TB Seagate modded RAID0 Btrfs-Compression
- 480GB Intel SSD for modded dm-cache (initramfs auto update patch) and Apps

When posting, consider checking the box "Notify me when a reply is posted" to get faster response
dmtparker
Posts: 27
Joined: Wed Aug 04, 2021 10:56 pm

Re: Help using Backup & Restore Utility with Linux

Post by dmtparker »

Man, I thought I had it. I edited .conf file changing auth user, I had to change 'uid and gid from 'nobody' to mark and then restart rsynd and I was able to log in either as mark or as dmtparker and got a listing of all files in the module. However, when I tried to create a new backup, I got:
Screenshot-8.png
Screenshot-8.png (204.37 KiB) Viewed 3754 times
Grrr....
User avatar
Nazar78
Posts: 2003
Joined: Wed Jul 17, 2019 10:21 pm
Location: Singapore
Contact:

Re: Help using Backup & Restore Utility with Linux

Post by Nazar78 »

Oh yeah the uid/gid. IIRC I will usually comment those out but it might cause some issue with new folder creation unless you have exactly identical setup so yeah change those to match yours.

The secrets file is:
dmtparker:xxxxx (this is user on NAS)
root:xxxxx
mark:xxxxxxx (this is user on Linux box)

From your screenshot, shouldn't you use mark instead of dmtparker on the Backup & Restore utility? Because mark is an account on the linux box...
AS5304T - 16GB DDR4 - ADM-OS modded on 2GB RAM
Internal:
- 4x10TB Toshiba RAID10 Ext4-Journal=Off
External 5 Bay USB3:
- 4x2TB Seagate modded RAID0 Btrfs-Compression
- 480GB Intel SSD for modded dm-cache (initramfs auto update patch) and Apps

When posting, consider checking the box "Notify me when a reply is posted" to get faster response
dmtparker
Posts: 27
Joined: Wed Aug 04, 2021 10:56 pm

Re: Help using Backup & Restore Utility with Linux

Post by dmtparker »

I thought I posted a reply last night, but I don't see it, so here it is again.
The different user makes sense and I tried it, but got the same results, program hangs while trying to connect.
Not sure what to try next.
dmtparker
Posts: 27
Joined: Wed Aug 04, 2021 10:56 pm

Re: Help using Backup & Restore Utility with Linux

Post by dmtparker »

FWIW, I tried host = 192.168.1.3/mark and mark@192.168.1.3/mark and this time, it doesn't hang, but instead gives the Error message: Unable to connect to rsync server. (Ref. 5010)
User avatar
Nazar78
Posts: 2003
Joined: Wed Jul 17, 2019 10:21 pm
Location: Singapore
Contact:

Re: Help using Backup & Restore Utility with Linux

Post by Nazar78 »

dmtparker wrote:FWIW, I tried host = 192.168.1.3/mark and mark@192.168.1.3/mark and this time, it doesn't hang, but instead gives the Error message: Unable to connect to rsync server. (Ref. 5010)
Because that's not a host or ip.
AS5304T - 16GB DDR4 - ADM-OS modded on 2GB RAM
Internal:
- 4x10TB Toshiba RAID10 Ext4-Journal=Off
External 5 Bay USB3:
- 4x2TB Seagate modded RAID0 Btrfs-Compression
- 480GB Intel SSD for modded dm-cache (initramfs auto update patch) and Apps

When posting, consider checking the box "Notify me when a reply is posted" to get faster response
Post Reply

Return to “Backup and Data Protection”