In general, if we want to access the remote server, we need to download the key, "token.pem". Put the key to the specific path, "$HOME/token.pem". Then use chmod 400 $HOME/token.pem and ssh -i $HOME/token.pem user@hostname for access.
Now, I want to write the shell script, "connection.sh". In this script, I want to write look like ssh "RSA PRIVATE KEY" user@hostname in the "connection.sh" file. Then I can use "sh connection.sh" to access my server without "-i".
How to modified the code in the shell script?
https://stackoverflow.com/questions/66558218/put-the-rsa-private-key-in-the-shh-command-directly March 10, 2021 at 12:06PM
没有评论:
发表评论