Friday, December 31, 2021

How to create user and configure password less ssh between OS users in Solaris 11

 


Hi, in this topic we learn how to created password less connectivity between two different Solaris Server with OS users:

For SSH Connectivity between Primary and Slave Node and with OS user creation in solaris 11:
apploci@ebsprodapp3:~$ id
uid=1007(apploci) gid=101(dba)
apploci@ebsprodapp3:~$ 


root@ebsprodapp4:~# mkdir /export/home/apploci
root@ebsprodapp4:~# touch /export/home/apploci/.profile
root@ebsprodapp4:~#
root@ebsprodapp4:~# chown -R apploci:dba /export/home/apploci
root@ebsprodapp4:~# chown  apploci:dba /export/home/apploci/.profile
root@ebsprodapp4:~# usermod -s /usr/bin/sh apploci
root@ebsprodapp4:~#
root@ebsprodapp4:~# passwd apploci
New Password:
Re-enter new Password:
passwd: password successfully changed for apploci
root@ebsprodapp4:~# 
root@ebsprodapp4:~# su - apploci
apploci@ebsprodapp4:~$ id
uid=1007(apploci) gid=101(dba)
apploci@ebsprodapp4:~$

ssh key gen to access form app4 to app3:
apploci@ebsprodapp3:~$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/export/home/apploci/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /export/home/apploci/.ssh/id_rsa.
Your public key has been saved in /export/home/apploci/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:Is0bCpfhufTXUp/Gne7Ks2w+4UhhrMD0IRwCSJIrT0U apploci@ebsprodapp3
The key's randomart image is:
+---[RSA 2048]----+
|o+.oE...         |
|+   ..+ .        |
| . ..o o o       |
|o .. *o . +      |
|.o. B =.So..     |
|  .+ = +.o.o.o . |
|    o o o..o=.o  |
|       . ..+=.   |
|           o**o  |
+----[SHA256]-----+
apploci@ebsprodapp3:~$
apploci@ebsprodapp3:~$ touch ~/.ssh/authorized_keys
apploci@ebsprodapp3:~$
apploci@ebsprodapp3:~$
apploci@ebsprodapp4:~$ ssh-keygen
apploci@ebsprodapp4:~$ cat ~/.ssh/id_rsa.pub | ssh ebsprodapp3 'cat >>~/.ssh/authorized_keys && echo "Host Key Copied"'
Password:
Host Key Copied
apploci@ebsprodapp4:~$
apploci@ebsprodapp4:~$ ssh ebsprodapp3

########################
ssh key gen to access form app3 to app4:
apploci@ebsprodapp4:~$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/export/home/apploci/.ssh/id_rsa):
/export/home/apploci/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /export/home/apploci/.ssh/id_rsa.
Your public key has been saved in /export/home/apploci/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:yEoIz4AnNENhP96sbDUqosYHBCFczZgSINlcTwZOfbE apploci@ebsprodapp4
The key's randomart image is:
+---[RSA 2048]----+
|O&+oOoo ..       |
|Oo*= *. ..       |
|* oo. ..E        |
| O..+. .         |
|. +..=o S        |
| ...+..          |
|o..=.            |
|ooo.             |
|o .              |
+----[SHA256]-----+
apploci@ebsprodapp4:~$
apploci@ebsprodapp4:~$ touch ~/.ssh/authorized_keys
apploci@ebsprodapp3:~$ cat ~/.ssh/id_rsa.pub | ssh ebsprodapp4 'cat >>~/.ssh/authorized_keys && echo "Host Key Copied"'
Password:
Host Key Copied
apploci@ebsprodapp3:~$ ssh ebsprodapp4
apploci@ebsprodapp4:~$ ssh ebsprodapp3
################################



Thanks for Reading


Regards,
Mohammed Areefuddin.

No comments:

Post a Comment