User Authentication using Keys via PuTTY
SAP Admins have to constantly log in to the server at OS level to carry out their every day tasks. A normal setup of SAP landscapes involves tens and hundreds of servers and logging on to these servers using passwords is error prone or slightly delayed by requiring to access password vaults.
A simple solution is to use public-private keys to authenticate the users. You generate a key pair. Keep the private key a secret and upload the public key on the server. Then use the private key while logging on through PuTTY. Because you are keeping Private Key a secret, server accepts connections via the Private Key to recognize you.
A simple solution is to use public-private keys to authenticate the users. You generate a key pair. Keep the private key a secret and upload the public key on the server. Then use the private key while logging on through PuTTY. Because you are keeping Private Key a secret, server accepts connections via the Private Key to recognize you.
To set this up we first need to create the key pair
- Download PuTTYgen and start it
- Click on Generate button to generate public and private key pair
- Move the mouse cursor to generate randomness
- Save the private key and copy the public key (or save the public key)
- We now have the key pair
Place the Public Key on the server
- Log on to the server with the user name for which you want to set this authentication up
- Create .ssh folder
mkdir ~/.ssh - Create authorized_keys file with the public key as its contents (you have copied or saved it in step 4 above)
cd ~/.ssh
vi authorized_keys - Make sure directory can be traversed only by user user ID (some operating systems will not authenticate if other users can view or edit the keys)
chmod 700 ~/.ssh - Make sure authorized_keys is accessible only on your user ID
chmod 600 ~/.ssh/authorized_keys
Set up PuTTY to authenticate using Private Key
- Start PuTTY and populate the hostname or IP address of the server to which you wish to connect
- On the left hand side, choose Connection > Data and populate the user ID
- Now expand SSH > Auth and populate the path to your Private Key
- Save your changes
- Next time you wish to log on, open the save PuTTY session!
All of this is obviously possible if the server allows authentication through keys. Did you know, you can log on to Service Marketplace without passwords, using logon tickets?
Comments
Post a Comment