-
Notifications
You must be signed in to change notification settings - Fork 5
SSH passphrase being asked multiple times #2
Comments
Hey, sorry about not getting back sooner. Are you connecting to an rsync.net server or some other provider? Also, maybe more importantly, have you checked the log file? There should a line in there right before the backups start that says "Borg SSH/REPO password... OK" assuming it's being read properly from the nc_borg.details file. Otherwise, is it showing an error? Finally, are you sure you are entering the password exactly on line 4? If you use a text editor, sometimes lines get wrapped and that causes errors, so just asking. Let me know those answers and I'm happy to check into things further for you. Sorry you are having a problem getting things to work! |
Just another thought: I actually never really tested the password using certain special characters like ( ) or any quotes like ` ' ". I don't recommend using these in passwords that will be scripted since they tend to confuse shells and ssh in general so I avoid them... but I never noted that in the readme or anything. Is it possible you are using characters like those in your password? Is the password still something you can change (i.e. new SSH keys). If you can change the key without having to lose data or something, then perhaps try a password that that is maybe longer but only alphanumeric or uses only 'safe' special characters like - _ ! % ^ * , . Just throwing it out there... if this ends up being the problem, then I'll have to look into taking that into account in the script. |
Hello again, I have the borg remote repository in an external server, the password is in the fourth line and I am actually not using any special characters for the SSH key/password. There are no signals of the password not being correctly read, I ran it a couple of times and I am getting an error because the version of borg in the remote server is too old, and some other directories not being found. From what I understand, the SSH paraphrase and the borg password have to be the same, or is there any possibility to configure them different? Thanks a lot! Here is the log:
|
Thanks for the log. Based on it, I see that the backups are completed successfully and the script is properly reading your REPO password. What's happening is my fault for my the wording of my script and documentation being misleading... I will fix that in a future release... I'm 99% sure this is the situation: You are being prompted by SSH (NOT borg or my script) for your SSH key's password. This is outside the control of borg and, subsequently, my script. You would need to store your SSH password in something like a GNOME keyring or another option (check the SSH man pages) so that SSH can read it securely. Your SSH password and your borg repo password are two separate things, even if they share the same password. There are two steps to connecting to your borg repo. The first is SSHing to the remote system. Then you supply a key and password to borg to decrypt and access your repo for updating/pruning/etc. I recommend having an SSH key with NO password and then relying on your borg repo password and key for enhanced security. That way you're still connecting via an SSH key (securely) but the script will handle accessing your repo via a key and password with no prompts or required user interaction. Does that make sense? If you want to continue using an SSH key with a password, you have to set that up via SSH itself (since borg just uses SSH as-is) and that is outside the scope of my script because the implementation varies so widely depending on your system setup. Simply put, unless you provide some kind of keyring system for SSH to use, it will sit and wait for you to enter a password for the key... unless there is no password :-) If this isn't making sense, let me know and I'll try to explain better... Regarding the other errors: Regarding the InvalidRPCMethod(method) error: You are correct, that is because you are using borg 1.1+ on your client and borg 1.0 on your server. You can ignore those errors or, better yet, update your server. I hope this helps? By the way, thanks for the kind words about the script :-) I hope it helps you once you get this stuff figured out! Please let me know if you need any more help or if I totally lost you in the long reply. |
Hi, thanks for the detailed explanation. I understand the difference between SSH passphrase and BORG password, but as you said, your readme is a bit unclear about it :P so I just assumed they had to be the same. But I managed to solve the error with your help and now I can set a cronjob. Thanks!! |
Glad you got it all working. I'll fix the relevant sections of the in-script help and the readme soon to make this whole issue clearer and re-release -- thanks for pointing it out @fernandodrf :-) |
Hi there, this is a nice script, thanks for sharing! I am using it to backup a self-hosted Nextcloud server. I keep getting asked for the passphrase for the ssh key that I use to connect to the remote server, even though I wrote it in the nc_borg.details file. Am I missing something?
Thanks a lot for the help!
The text was updated successfully, but these errors were encountered: