Can't init a new sftp repo


#1

When I run:

restic init -r sftp://user@c3po:/mnt/bak/test

I get back:
subprocess ssh: Bad port ‘’
Fatal: create repository at sftp://user@c3po:/mnt/bak/test failed: unable to start the sftp session, error: EOF

SSH runs on port 22 on c3po. I have tried explicitly setting the port in ~/.ssh/config

Am I missing something obvious?


#2

Try without slashes:
restic init -r sftp:user@c3po:/mnt/bak/test


#3

Indeed, @764287 posted the right syntax for the sftp backend, is it still mentioned in the docs somewhere? I’m asking so I can remove it :slight_smile:


#4

Hi,

I have the same Issues…

–>
restic -r sftp:user@server.tld:/home/user/backup backup --tag Automatic_backup files
subprocess ssh: subsystem request failed on channel 0
Fatal: unable to open repo at sftp:user@server.tld:/home/user/backup failed: unable to start the sftp session, error: EOF
<–

It’s an automatic process (cronjob) and it worked until the day before yesterday. I have not made any changes to any process.

The same error I get even when I try to create a new repo.

A “normal” connection via SSH or SCP works easily.


#5

My bad, it was late night and I’m used to typing double slashes. It’s working for me with correct syntax.


#6

That’s probably an issue with the ssh client. Can you try running ssh -v user@server.tld -s sftp and see what it prints?

Then, you can add the option -o sftp.command='ssh -v user@server.tld -s sftp' to restic, that will start the ssh command with debug output enabled.


#7

I found the problem…
A typical Layer 8 problem, I had overlooked something in the config of the SSH server.

Thanks & case closed