Tuesday, April 23, 2024

Create a ssh key for different users and suders privilege for the users. ( Oracle Cloud)

      1) Use puttygen to generate private and public keys. Save both private and public keys.
 2)     On server go to .ssh directory under user home. Here creates a file name  authorized_keys and copy the private key content here.
 3)     Give permission 600 to authorized_keys.
 4)      In file /etc/ssh/sshd_config add below lines
   AllowUsers opc postgres elk 

a    Also need to add users in /etc/sudoers file

%oracle ALL=(ALL) NOPASSWD: ALL

 5)      systemctl restart sshd


No comments:

Post a Comment