Tuesday 29 June 2021

OCI - Create Instance and connect on linux machine

 Configuring connection to the vm from a Linux shell session

  • Create Compute Instance 




  • Select Image and shape 



  • Networking : Select subnet 







  • Save private Key and public key  and create instance 








  • Login to any linux server that we wanted to connect and create directory  copy private and public key to linux directory so we can get connect to apptier instance 

[root@srv3 app]# mkdir -p /u01/apptierkey
[root@srv3 app]# cp ssh-key-2021-06-28.key Public_ssh-key-2021-06-28.key.pub /u01/apptierkey
[root@srv3 app]# cd /u01/apptierkey
[root@srv3 apptierkey]# ll
total 8
-rwxr-x--- 1 root root  399 Jun 28 13:07 Public_ssh-key-2021-06-28.key.pub
-rwxr-x--- 1 root root 1679 Jun 28 13:07 ssh-key-2021-06-28.key

  • Provide chmod 600 permission to private key 
[root@srv3 apptierkey]# chmod 600 ssh-key-2021-06-28.key
[root@srv3 apptierkey]#



  • Copy public IP address




[root@srv3 apptierkey]# ll
total 8
-rwxr-x--- 1 root root  399 Jun 28 13:07 Public_ssh-key-2021-06-28.key.pub
-rw------- 1 root root 1679 Jun 28 13:07 ssh-key-2021-06-28.key


[root@srv3 apptierkey]# ssh -i /u01/apptierkey/ssh-key-2021-06-28.key opc@140.238.242.52
The authenticity of host '140.238.242.52 (140.238.242.52)' can't be established.
RSA key fingerprint is f3:2a:55:5b:b4:c3:43:b4:80:82:cd:20:85:dd:d5:6e.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '140.238.242.52' (RSA) to the list of known hosts.


[opc@appvm ~]$ id
uid=1000(opc) gid=1000(opc) groups=1000(opc),4(adm),10(wheel),190(systemd-journal) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[opc@appvm ~]$ hostname
appvm


No comments:

Post a Comment