The general way to create a secure shell connection with a remote machine is :-
(Example)
ssh -i key_file_path username@server_name_etc.amzonaws.com
Now, it gets a little cumbersome to do this every-time you sit and try to connect to the remote machine.
The simple way to do this:-
the very first time that you execute the ssh command, a folder named ".ssh" is created in the default directory. If it is not there, try and search it in parent directories.
So, let us assume you get to this .ssh directory. Now, you are supposed to create a file named "config" and put entries similar to the one I am going to mention below:-
Host awsHost1
HostName bla-bla-bla-compute.amazonaws.com
User ubuntu
IdentityFile "~/myKeyFile.pem"
.
After doing this, all you need to execute to get the ssh connection is
$ ssh awsHost1
Also, doing th escp stuf also becomes a lot easier !!
It goes something like this.
# -- Execute on local computer
# Copy hello.txt from local computer to remote home directory
$ scp hello.txt awshost1:~/
# Copy hello.txt from local to remote home directory, renaming it foo.txt
$ scp hello.txt awshost1:~/foo.txt
This way, the typing effort gets a lot reduced and this is the ideal and standard way most of the professionals do it.
(Example)
ssh -i key_file_path username@server_name_etc.amzonaws.com
Now, it gets a little cumbersome to do this every-time you sit and try to connect to the remote machine.
The simple way to do this:-
the very first time that you execute the ssh command, a folder named ".ssh" is created in the default directory. If it is not there, try and search it in parent directories.
So, let us assume you get to this .ssh directory. Now, you are supposed to create a file named "config" and put entries similar to the one I am going to mention below:-
Host awsHost1
HostName bla-bla-bla-compute.amazonaws.com
User ubuntu
IdentityFile "~/myKeyFile.pem"
.
After doing this, all you need to execute to get the ssh connection is
$ ssh awsHost1
Also, doing th escp stuf also becomes a lot easier !!
It goes something like this.
# -- Execute on local computer
# Copy hello.txt from local computer to remote home directory
$ scp hello.txt awshost1:~/
# Copy hello.txt from local to remote home directory, renaming it foo.txt
$ scp hello.txt awshost1:~/foo.txt
This way, the typing effort gets a lot reduced and this is the ideal and standard way most of the professionals do it.