Put the "RSA PRIVATE KEY" in the shh command directly.

houzeyu2683

New Member
Joined
Mar 10, 2021
Messages
1
Reaction score
0
Credits
14
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?
 

Members online


Top