-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use ssh if remote host does not support echo command (Hetzner Storage Box) #1442
Comments
Dear @phoyer , First I thought it is a syntax problem because of the Please let me ask some questions: What type of machine is your Can you login locally into that machine? Please do und try Also try to login via ssh into a shell. Again do Please show the output of Note for the @bit-team : |
The machine is not a real Linux server (or at least you do not have shell access) but it is a storage system "Hetzner Storage Box". Available commands are limited: uxxx-sub4 /home > echo
Command not found. Use 'help' to get a list of available commands.
uxxx-sub4 /home > help
+-----------------------------------------------------------------------------+
| The following commands are available: |
| ls list directory content |
| tree list directory content |
| cd change current working directory |
| pwd show current working directory |
| mkdir create new directory |
| rmdir delete directory |
| du disk usage of files/directories |
| df show disk usage |
| dd read and write files |
| cat output file content |
| touch create new file |
| cp copy files/directories |
| rm delete files/directories |
| unlink delete file/directory |
| mv move files/directories |
| chmod change file/directory permissions |
| md5|sha1|sha256|sha512 create hash sum of file |
| md5sum|sha1sum|sha256sum|sha512sum create hash sum of file |
| head show first lines of file |
| tail show last lines of file |
| grep search for specific string in files |
| stat stat files/directory |
| |
| Available as server side backend: |
| borg |
| rsync |
| scp |
| sftp |
| rclone serve restic --stdio |
| |
| Please note that this is only a restricted shell which do not |
| support shell features like redirects or pipes. |
| |
| You can find more information in our Docs: |
| https://docs.hetzner.com/robot/storage-box/ |
+-----------------------------------------------------------------------------+ I suppose, the have used I am using backintime 1.2.1 installed through Ubuntu 22.04 apt. |
Interesting use case. Please note that your BIT version is outdated for years. But it also won't solve your current problem updating to a newer version. Before modifying anything can you please reproduce the problem while running backintime with the Can you create aliases on your hetzner shell? It is not a usual bash/sh shell I think. But if aliases work just try Another try would be you modify the code your self. This is the location in your version of the code. Try to modify that line
into that
Another option for a short term solution/workaround would be to contact Hetzer and ask them to make "echo" available or creating an alias for it. Now sure how many options they have on their site. |
You can disable |
Hello Germar, @phoyer Thinking out loud: |
I just doubble-checked the code, I used |
@buhtz when looking at the code in lines 425 and 465 of test_sshtools.py, it does not check at all if there is "Hello" as output of the echo command, but it only checks the command's return value. I have replaced this by DEBUG: [common/sshtools.py:350 SSH.unlockSshAgent] Password available: True
DEBUG: [common/sshtools.py:567 SSH.checkKnownHosts] Check known hosts file
DEBUG: [common/sshtools.py:580 SSH.checkKnownHosts] Host u142xxx.your-backup.de was found in known hosts file
DEBUG: [common/sshtools.py:423 SSH.checkLogin] Check login
**ERROR: [qt/settingsdialog.py:1597 SettingsDialog.saveProfile] Password-less authentication for [email protected] failed. Look at 'man backintime' for further instructions.**
DEBUG: [common/sshtools.py:1059 sshCopyId] Call command "ssh-copy-id -i /home/phoyer/.ssh/id_rsa.pub -p 23 [email protected]"
INFO: [common/sshtools.py:1075 sshCopyId] Successfully copied ssh-key "/home/phoyer/.ssh/id_rsa.pub" to "[email protected]" Testing pwd in command line: ssh [email protected] -p 23
Last login: Tue Jun 13 10:00:00 2023 from host-79-54-219-144.retail.telecomitalia.it
+------------------------------------------------------------------+
| Welcome to your Storage Box. |
| |
| Please note that this is only a restricted shell environment and |
| therefore some shell features like pipes and redirects are not |
| supported. |
+------------------------------------------------------------------+
u142xxx-sub4 /home > pwd
/home
u142xxx-sub4 /home > exit
Connection to u142xxx.your-backup.de closed. If someone likes to try out, I can also provide testing credentials by private message. |
Thanks for checking out and offering your credentials. Can I ask you for the favour to try out this code please?
As a first workaround you simply could add |
Your idea has been very useful. For some reason, using Instead with Now authentication is working perfectly. Unfortunately, this does not help as in further checks the tools uses other bash commands such as Thank you so much for you instant replies anyway and in general it may be useful to change |
Also thanks for your help. I'll keep this Issue open until it is fixed for all users. My current proposal is to just use
EDITDear @phoyer , But it would be OK for me if you could just test the code above and show me the output. I suspect this would work. When you confirm that it works I will integrate it in the code. |
Hello @phoyer , Kind |
I vote to implement this even without feedback from @phoyer . |
Checking login and cipher on a SSH remote host now using exit command instead of echo. This should work on machines with limited commands (e.g. Hetzer storage boxes) also. Fix #1442
Do you have any idea how I can use backintime if rsync and standard file operation commands are available but no echo command which backintime is using to check the connection?
ssh -o PreferredAuthentications=publickey -p 22 -o ServerAliveInterval=240 -o IdentityFile=/home/[user]/.ssh/[id]_rsa backup@[my-local-ip] echo "Hello"
fails with
Command not found. Use 'help' to get a list of available commands.
ssh -o PreferredAuthentications=publickey -p 22 -o ServerAliveInterval=240 -o IdentityFile=/home/[user]/.ssh/[id]_rsa backup@[my-local-ip] ls
works fine.
The text was updated successfully, but these errors were encountered: