houzeyu2683
New Member
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?
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?