key-based ssh authentication

  • Post author:
  • Post category:SSH – Simple tar backup for free forever


feature request for tarbackup is using a private ssh key instead of a password to connect to the tarbackup server when using sftp to backup files. I’m happy to report that we now support public/private keys for sftp authentication!

To use an ssh key with tarbackup, first use this command to create your public/private key-pair:

# mkdir ~/.ssh
# cd ~/.ssh
# ssh-keygen -f tarbackup_rsa -C .youremail. -N . -t rsa -q

This will generate 2 files: tarbackup_rsa and tarbackup_rsa is your private ssh key, you will keep this on your computer as proof that you are who you are. is a public key that you send to the server so that can authenticate you when you log in via sftp in the future.

To use your private key to authenticate you when you login via sftp, you need to create an ssh_config file in your home directory with:

# echo "IdentityFile ~/.ssh/tarbackup_rsa" > ~/ssh_config

This is the config file that specifies where your private ssh key is.

You’ll pass the ssh_config file as a parameter to the sftp program when you connect to via sftp:

# sftp -F ~/ssh_config


And that’s it! Let me know if you have any feedback or questions@davidnanch.



I am a g33k, Linux blogger, developer, student and Tech Writer for My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....