Restic 0.16.4 backup via ssh

Hello Community,

how can I backup to a backup-server via scp ?
When I try to initialize the repo on the backup server using restic init I get

restic@server-url: Permission denied (publickey).
Fatal: create repository at sftp:restic@server-url:repo failed: unable to start the sftp session, error: EOF

I have configured ssh login with publickey+password and otp.
Does this work at all or do I have to configure password-login no in sshd_config?

Regards,

Does a normal ssh connection work? Can you try ssh restic@server-url "mkdir repo && ls -l"?

Hi nicnab,

I worked out a solution with sftp - so far so good. Next step is now to automize the daily backups of /home/user and the monthly system-backups with cronjobs. Therefor I am looking for an idea to solve the following challenge:

The backup-server uses 2FA authentication" ssh-publickey with otp" (google-authenticator).
Further the repos are password protected. Ok rhe passwords could be put into a variable but the otp? If you have an idea for that please let me know.

Many thanks,

Uli

Cool ok. I’m afraid I never had that situation but maybe someone else in here has?

I’ve never tried it*, but pass (https://www.passwordstore.org/) has an extension for managing OTP tokens, which sounds like it could be what you’re after?
GitHub - tadfisher/pass-otp: A pass extension for managing one-time-password (OTP) tokens

*I use pass and like it a lot, it’s the extension I’ve not tried :slight_smile: