Key-based FTP authentication

  1. make a strong ssh key $ ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa
  2. turn to RFC 4716 $ ssh-keygen -e -f ~/.ssh/
  3. add to ~/.ssh/authorized_sftpkeys on destination host
  4. try out:
    1. $ curl -u "<username>:" --key ~/.ssh/id_rsa --pubkey ~/.ssh/ -T <file to upload> sftp://<target host>/<target path>/
    2. $ lftp -u <username>,xx ... sftp://<target host>

P.S.: Hetzner FAQ zum Thema SFTP + Keys.

Post a Comment

Your email is never published nor shared. Required fields are marked *