Issue
I usually would do ssh -i PrivetKeyFileName localhost
, but this time, I only have the key, and I do not have write permission to save the key to a file and use it like shown.
is it possible to pass the key as an argument? (or any other solution really)
Solution
You can try the below command but it is only effective to a single runtime command on the remote machine.
echo $PrivateKEY | ssh -i /dev/stdin username@hostname command
Due to sensitive information in the key it is not recommended to use it in as a string. Try creating a file with correct permission and use it.
Answered By - Wasim Ansari Answer Checked By - Gilberto Lyons (WPSolving Admin)