Yubico Yubikey & SCP Command

How to SSH Secure copy (SCP) a file to a remote server, using a Yubikey

For anyone having difficulties with the scp command using yubikey, here is the proper syntax I used to copy a file from a local machine to a remote server:


scp -i ~/.ssh/id_rsa_yubikey.pub -P 22 local_file_to_be_transferred.txt remote_username@local_server_ip_address:/remote/directory_of_server

where -i = your yubikey identities file, -P = your ssh port, remote_username = your username that you use to log in to your server

In my case:

scp -i ~/.ssh/id_rsa_yubikey.pub -P 40001 /Users/Danrancan/Downloads/myfile.zip boopi@

This should successfully securely copy your file from your local machine to your remote machine or server.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.