sftp passwordless #233
Replies: 10 comments 2 replies
-
Hey, sorry about that -- looks like you ran afoul of a typo on the docs. I'm not at my computer right now to try this out but I believe the ssh flag you need for your identity file should be |
Beta Was this translation helpful? Give feedback.
-
It worked. Thank you so much. I found the wrong command in the 'Flags' section of this page: https://garethgeorge.github.io/backrest/introduction/getting-started But we find a new error: I tried to run: sftp [email protected]:/volume1/home/Giacomo/NAS from terminal and everything is ok. This work with no prob: Maybe there are same bad permission? i check id_rsa permission and i set it to chmod 600. nothing change. I paste here the NAS sshd_config file:
|
Beta Was this translation helpful? Give feedback.
-
I don't use SFTP on any of my devices -- but my understanding is that there are some finicky issues w/restic and how the SFTP URI is provided. https://forum.restic.net/t/cant-init-a-new-sftp-repo/885 may be related to your problem. It sounds like your repository should be If that works please go ahead and report back with the working config! I'd like to make a series of wiki entries covering the common restic remotes and pitfalls https://garethgeorge.github.io/backrest/ |
Beta Was this translation helpful? Give feedback.
-
Nothing change. using restic i setup and run 2 different backup via sftp and everything work fine (passworless). :-( |
Beta Was this translation helpful? Give feedback.
-
i think the issue here is that the container is being run as root and doesnt match the user of the remote sftp host which can be done by adding the flag: im not sure what the implications would be of running this container as user vs root 🤔 if there are no issues in that regard i would suggest making that the suggested default for docker/compose. another thing is mounting your key into the container. this is one way to get sftp working but another way is to have the container generate ssh keys for you, add it to your data dir, and present the pub key on the frontend. you would then just need to add that key to your remote hosts |
Beta Was this translation helpful? Give feedback.
-
Hello, my situation is similar, but I do not use docker. If I run backrest from command line SFTP config works like a charm. If I install it, it's not working anymore: it gives me authentication issue like jack and if I add the ssh key file with the -i param it returns me a libcrypto error. Maybe it's a user problem, but is there a way to fix it? Thanks |
Beta Was this translation helpful? Give feedback.
-
I grew tired of trying to fix this so I just used the rclone backend and it worked first time, not a single issue |
Beta Was this translation helpful? Give feedback.
-
I got sftp repo to work from Docker. Password on the repo config is the password you will use for restic, not the SFTP password. This single misunderstanding made me lose hours :( You have to use ssh keys, no way to use sftp with password for what I could see. If you use Docker, you need to have TTY enabled. I run docker from Truenas Scale and it has an UI with a "Enable TTY" checkbox, dunno how it works on other environments. You cannot set custom sftp args or you will get an error (see #165) |
Beta Was this translation helpful? Give feedback.
-
Added a few more debugging notes here: #278 (comment), to copy over some of the content from that discussion: General advice is to setup by first Whether using sftp.args OR sftp.command, it is important that you include -oBatchMode=yes as this will prevent the SSH process from blocking for input when encountering an error (e.g. running into the password prompt on the remote system). This can be very problematic when trying to debug access issues etc as commands will appear to simply hang without completing. See the linked comment for a few notes re: sftp.command usage, I suspect this is the easiest way to setup sftp. |
Beta Was this translation helpful? Give feedback.
-
I just installed Backrest and doing my tests over SFTP. Of course, I came across the issue of the sftp password. Here is how I managed to solve this.
Restart Backrest and there you go with the sftp connection without password with all your hosts that are already enabled with auth keys. |
Beta Was this translation helpful? Give feedback.
-
Hello everyone,
As a non-technical user, I need to backup terabytes of data from an Ubuntu PC to an Asustor AS6210T. I've connected the two devices with an Ethernet cable and configured the connection to use RSA keys instead of asking for a password. Currently, I can access the NAS passwordless via SSH and SFTP using the following address: [email protected]:/volume3.
I installed Restic using the command:
sudo apt install restic
, and then installed Backrest with./install.sh
.I attempted to create a new repository through the graphical interface but encountered an error. I configured it as follows:
The error message I received is as follows:
I then added the flag -o sftp.ssh_argument="-i /home/giacomo/.ssh/id_rsa", but encountered another error:
I then suspected that Restic might be installed incorrectly, but the following command successfully creates the repository, only prompting for the password:
This indicates that the RSA key is being read successfully.
I'm sure I'm missing some basic concept here, but I can't figure out where I'm going wrong.
Beta Was this translation helpful? Give feedback.
All reactions