ssh setup for oracle RAC
SSH setup for passwordless connectivity between nodes.
Node 1:-
/u01/Softwr/grid/sshsetup
[oracle@db-rac1 sshsetup]$ ./sshUserSetup.sh -user oracle -hosts "db-rac1 db-rac2" -noPromptPassphrase
The output of this script is also logged into /tmp/sshUserSetup_2017-02-06-21-13-55.log
Hosts are db-rac1 db-rac2
user is oracle
Platform:- Linux
Checking if the remote hosts are reachable
PING DB-rac1.localdomain (192.168.148.130) 56(84) bytes of data.
64 bytes from DB-rac1.localdomain (192.168.148.130): icmp_seq=1 ttl=64 time=0.209 ms
64 bytes from DB-rac1.localdomain (192.168.148.130): icmp_seq=2 ttl=64 time=0.042 ms
64 bytes from DB-rac1.localdomain (192.168.148.130): icmp_seq=3 ttl=64 time=0.041 ms
64 bytes from DB-rac1.localdomain (192.168.148.130): icmp_seq=4 ttl=64 time=0.042 ms
64 bytes from DB-rac1.localdomain (192.168.148.130): icmp_seq=5 ttl=64 time=0.041 ms
--- DB-rac1.localdomain ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4001ms
rtt min/avg/max/mdev = 0.041/0.075/0.209/0.067 ms
PING DB-rac2.localdomain (192.168.148.131) 56(84) bytes of data.
64 bytes from DB-rac2.localdomain (192.168.148.131): icmp_seq=1 ttl=64 time=2.16 ms
64 bytes from DB-rac2.localdomain (192.168.148.131): icmp_seq=2 ttl=64 time=0.385 ms
64 bytes from DB-rac2.localdomain (192.168.148.131): icmp_seq=3 ttl=64 time=0.268 ms
64 bytes from DB-rac2.localdomain (192.168.148.131): icmp_seq=4 ttl=64 time=0.370 ms
64 bytes from DB-rac2.localdomain (192.168.148.131): icmp_seq=5 ttl=64 time=0.170 ms
--- DB-rac2.localdomain ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4002ms
rtt min/avg/max/mdev = 0.170/0.671/2.162/0.749 ms
Remote host reachability check succeeded.
The following hosts are reachable: db-rac1 db-rac2.
The following hosts are not reachable: .
All hosts are reachable. Proceeding further...
firsthost db-rac1
numhosts 2
The script will setup SSH connectivity from the host db-rac1.localdomain to all
the remote hosts. After the script is executed, the user can use SSH to run
commands on the remote hosts or copy files between this host db-rac1.localdomain
and the remote hosts without being prompted for passwords or confirmations.
NOTE 1:
As part of the setup procedure, this script will use ssh and scp to copy
files between the local host and the remote hosts. Since the script does not
store passwords, you may be prompted for the passwords during the execution of
the script whenever ssh or scp is invoked.
NOTE 2:
AS PER SSH REQUIREMENTS, THIS SCRIPT WILL SECURE THE USER HOME DIRECTORY
AND THE .ssh DIRECTORY BY REVOKING GROUP AND WORLD WRITE PRIVILEDGES TO THESE
directories.
Do you want to continue and let the script make the above mentioned changes (yes/no)?
yes
The user chose yes
User chose to skip passphrase related questions.
Creating .ssh directory on local host, if not present already
Creating authorized_keys file on local host
Changing permissions on authorized_keys to 644 on local host
Creating known_hosts file on local host
Changing permissions on known_hosts to 644 on local host
Creating config file on local host
If a config file exists already at /home/oracle/.ssh/config, it would be backed up to /home/oracle/.ssh/config.backup.
Removing old private/public keys on local host
Running SSH keygen on local host with empty passphrase
Generating public/private rsa key pair.
Your identification has been saved in /home/oracle/.ssh/id_rsa.
Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.
The key fingerprint is:
31:36:f4:a8:d9:fb:95:a5:cb:2c:ad:0b:79:fc:88:4d oracle@db-rac1.localdomain
Creating .ssh directory and setting permissions on remote host db-rac1
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR oracle. THIS IS AN SSH REQUIREMENT.
The script would create ~oracle/.ssh/config file on remote host db-rac1. If a config file exists already at ~oracle/.ssh/config, it would be backed up to
~oracle/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host db-rac1.
Warning: Permanently added 'db-rac1,192.168.148.130' (RSA) to the list of known hosts.
oracle@db-rac1's password:
Done with creating .ssh directory and setting permissions on remote host db-rac1.
Creating .ssh directory and setting permissions on remote host db-rac2
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR oracle. THIS IS AN SSH REQUIREMENT.
The script would create ~oracle/.ssh/config file on remote host db-rac2. If a config file exists already at ~oracle/.ssh/config, it would be backed up to
~oracle/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host db-rac2.
Warning: Permanently added 'db-rac2,192.168.148.131' (RSA) to the list of known hosts.
oracle@db-rac2's password:
Done with creating .ssh directory and setting permissions on remote host db-rac2.
Copying local host public key to the remote host db-rac1
The user may be prompted for a password or passphrase here since the script would be using SCP for host db-rac1.
oracle@db-rac1's password:
Done copying local host public key to the remote host db-rac1
Copying local host public key to the remote host db-rac2
The user may be prompted for a password or passphrase here since the script would be using SCP for host db-rac2.
oracle@db-rac2's password:
Done copying local host public key to the remote host db-rac2
cat: /home/oracle/.ssh/known_hosts.tmp: No such file or directory
cat: /home/oracle/.ssh/authorized_keys.tmp: No such file or directory
SSH setup is complete.
------------------------------------------------------------------------
Verifying SSH setup
===================
The script will now run the date command on the remote nodes using ssh
to verify if ssh is setup correctly. IF THE SETUP IS CORRECTLY SETUP,
THERE SHOULD BE NO OUTPUT OTHER THAN THE DATE AND SSH SHOULD NOT ASK FOR
PASSWORDS. If you see any output other than date or are prompted for the
password, ssh is not setup correctly and you will need to resolve the
issue and set up ssh again.
The possible causes for failure could be:
1. The server settings in /etc/ssh/sshd_config file do not allow ssh
for user oracle.
2. The server may have disabled public key based authentication.
3. The client public key on the server may be outdated.
4. ~oracle or ~oracle/.ssh on the remote host may not be owned by oracle.
5. User may not have passed -shared option for shared remote users or
may be passing the -shared option for non-shared remote users.
6. If there is output in addition to the date, but no password is asked,
it may be a security alert shown as part of company policy. Append the
additional text to the <OMS HOME>/sysman/prov/resources/ignoreMessages.txt file.
------------------------------------------------------------------------
--db-rac1:--
Running /usr/bin/ssh -x -l oracle db-rac1 date to verify SSH connectivity has been setup from local host to db-rac1.
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note
that being prompted for a passphrase may be OK but being prompted for a password is ERROR.
Mon Feb 6 21:14:18 PST 2017
------------------------------------------------------------------------
--db-rac2:--
Running /usr/bin/ssh -x -l oracle db-rac2 date to verify SSH connectivity has been setup from local host to db-rac2.
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note
that being prompted for a passphrase may be OK but being prompted for a password is ERROR.
Mon Feb 6 21:14:19 PST 2017
------------------------------------------------------------------------
SSH verification complete.
[oracle@db-rac1 sshsetup]$
NOde2:-
[oracle@db-rac2 sshsetup]$ ./sshUserSetup.sh -user oracle -hosts "db-rac1 db-rac2" -noPromptPassphrase
The output of this script is also logged into /tmp/sshUserSetup_2017-02-06-21-14-42.log
Hosts are db-rac1 db-rac2
user is oracle
Platform:- Linux
Checking if the remote hosts are reachable
PING DB-rac1.localdomain (192.168.148.130) 56(84) bytes of data.
64 bytes from DB-rac1.localdomain (192.168.148.130): icmp_seq=1 ttl=64 time=0.589 ms
64 bytes from DB-rac1.localdomain (192.168.148.130): icmp_seq=2 ttl=64 time=0.317 ms
64 bytes from DB-rac1.localdomain (192.168.148.130): icmp_seq=3 ttl=64 time=0.367 ms
64 bytes from DB-rac1.localdomain (192.168.148.130): icmp_seq=4 ttl=64 time=0.288 ms
64 bytes from DB-rac1.localdomain (192.168.148.130): icmp_seq=5 ttl=64 time=0.390 ms
--- DB-rac1.localdomain ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4000ms
rtt min/avg/max/mdev = 0.288/0.390/0.589/0.106 ms
PING DB-rac2.localdomain (192.168.148.131) 56(84) bytes of data.
64 bytes from DB-rac2.localdomain (192.168.148.131): icmp_seq=1 ttl=64 time=0.107 ms
64 bytes from DB-rac2.localdomain (192.168.148.131): icmp_seq=2 ttl=64 time=0.166 ms
64 bytes from DB-rac2.localdomain (192.168.148.131): icmp_seq=3 ttl=64 time=0.040 ms
64 bytes from DB-rac2.localdomain (192.168.148.131): icmp_seq=4 ttl=64 time=0.039 ms
64 bytes from DB-rac2.localdomain (192.168.148.131): icmp_seq=5 ttl=64 time=0.040 ms
--- DB-rac2.localdomain ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4003ms
rtt min/avg/max/mdev = 0.039/0.078/0.166/0.051 ms
Remote host reachability check succeeded.
The following hosts are reachable: db-rac1 db-rac2.
The following hosts are not reachable: .
All hosts are reachable. Proceeding further...
firsthost db-rac1
numhosts 2
The script will setup SSH connectivity from the host db-rac2.localdomain to all
the remote hosts. After the script is executed, the user can use SSH to run
commands on the remote hosts or copy files between this host db-rac2.localdomain
and the remote hosts without being prompted for passwords or confirmations.
NOTE 1:
As part of the setup procedure, this script will use ssh and scp to copy
files between the local host and the remote hosts. Since the script does not
store passwords, you may be prompted for the passwords during the execution of
the script whenever ssh or scp is invoked.
NOTE 2:
AS PER SSH REQUIREMENTS, THIS SCRIPT WILL SECURE THE USER HOME DIRECTORY
AND THE .ssh DIRECTORY BY REVOKING GROUP AND WORLD WRITE PRIVILEDGES TO THESE
directories.
Do you want to continue and let the script make the above mentioned changes (yes/no)?
yes
The user chose yes
User chose to skip passphrase related questions.
Creating .ssh directory on local host, if not present already
Creating authorized_keys file on local host
Changing permissions on authorized_keys to 644 on local host
Creating known_hosts file on local host
Changing permissions on known_hosts to 644 on local host
Creating config file on local host
If a config file exists already at /home/oracle/.ssh/config, it would be backed up to /home/oracle/.ssh/config.backup.
Removing old private/public keys on local host
Running SSH keygen on local host with empty passphrase
Generating public/private rsa key pair.
Your identification has been saved in /home/oracle/.ssh/id_rsa.
Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.
The key fingerprint is:
7e:29:60:e1:c3:e0:53:18:e2:e5:59:49:9f:79:e8:db oracle@db-rac2.localdomain
Creating .ssh directory and setting permissions on remote host db-rac1
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR oracle. THIS IS AN SSH REQUIREMENT.
The script would create ~oracle/.ssh/config file on remote host db-rac1. If a config file exists already at ~oracle/.ssh/config, it would be backed up to
~oracle/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host db-rac1.
Warning: Permanently added 'db-rac1,192.168.148.130' (RSA) to the list of known hosts.
oracle@db-rac1's password:
Done with creating .ssh directory and setting permissions on remote host db-rac1.
Creating .ssh directory and setting permissions on remote host db-rac2
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR oracle. THIS IS AN SSH REQUIREMENT.
The script would create ~oracle/.ssh/config file on remote host db-rac2. If a config file exists already at ~oracle/.ssh/config, it would be backed up to
~oracle/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host db-rac2.
Warning: Permanently added 'db-rac2,192.168.148.131' (RSA) to the list of known hosts.
oracle@db-rac2's password:
Done with creating .ssh directory and setting permissions on remote host db-rac2.
Copying local host public key to the remote host db-rac1
The user may be prompted for a password or passphrase here since the script would be using SCP for host db-rac1.
oracle@db-rac1's password:
Done copying local host public key to the remote host db-rac1
Copying local host public key to the remote host db-rac2
The user may be prompted for a password or passphrase here since the script would be using SCP for host db-rac2.
oracle@db-rac2's password:
Done copying local host public key to the remote host db-rac2
cat: /home/oracle/.ssh/known_hosts.tmp: No such file or directory
cat: /home/oracle/.ssh/authorized_keys.tmp: No such file or directory
SSH setup is complete.
------------------------------------------------------------------------
Verifying SSH setup
===================
The script will now run the date command on the remote nodes using ssh
to verify if ssh is setup correctly. IF THE SETUP IS CORRECTLY SETUP,
THERE SHOULD BE NO OUTPUT OTHER THAN THE DATE AND SSH SHOULD NOT ASK FOR
PASSWORDS. If you see any output other than date or are prompted for the
password, ssh is not setup correctly and you will need to resolve the
issue and set up ssh again.
The possible causes for failure could be:
1. The server settings in /etc/ssh/sshd_config file do not allow ssh
for user oracle.
2. The server may have disabled public key based authentication.
3. The client public key on the server may be outdated.
4. ~oracle or ~oracle/.ssh on the remote host may not be owned by oracle.
5. User may not have passed -shared option for shared remote users or
may be passing the -shared option for non-shared remote users.
6. If there is output in addition to the date, but no password is asked,
it may be a security alert shown as part of company policy. Append the
additional text to the <OMS HOME>/sysman/prov/resources/ignoreMessages.txt file.
------------------------------------------------------------------------
--db-rac1:--
Running /usr/bin/ssh -x -l oracle db-rac1 date to verify SSH connectivity has been setup from local host to db-rac1.
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note
that being prompted for a passphrase may be OK but being prompted for a password is ERROR.
Mon Feb 6 21:15:12 PST 2017
------------------------------------------------------------------------
--db-rac2:--
Running /usr/bin/ssh -x -l oracle db-rac2 date to verify SSH connectivity has been setup from local host to db-rac2.
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note
that being prompted for a passphrase may be OK but being prompted for a password is ERROR.
Mon Feb 6 21:15:12 PST 2017
------------------------------------------------------------------------
SSH verification complete.
[oracle@db-rac2 sshsetup]$
[grid@db-rac1 sshsetup]$ ssh db-rac2 It is working from node 1 to node 2
[grid@db-rac2 ~]$ ssh db-rac1 It is working from node 2 to node 1
Last login: Sat Feb 11 04:03:43 2017
[grid@db-rac1 ~]$
SSH setup for passwordless connectivity between nodes.
Node 1:-
/u01/Softwr/grid/sshsetup
[oracle@db-rac1 sshsetup]$ ./sshUserSetup.sh -user oracle -hosts "db-rac1 db-rac2" -noPromptPassphrase
The output of this script is also logged into /tmp/sshUserSetup_2017-02-06-21-13-55.log
Hosts are db-rac1 db-rac2
user is oracle
Platform:- Linux
Checking if the remote hosts are reachable
PING DB-rac1.localdomain (192.168.148.130) 56(84) bytes of data.
64 bytes from DB-rac1.localdomain (192.168.148.130): icmp_seq=1 ttl=64 time=0.209 ms
64 bytes from DB-rac1.localdomain (192.168.148.130): icmp_seq=2 ttl=64 time=0.042 ms
64 bytes from DB-rac1.localdomain (192.168.148.130): icmp_seq=3 ttl=64 time=0.041 ms
64 bytes from DB-rac1.localdomain (192.168.148.130): icmp_seq=4 ttl=64 time=0.042 ms
64 bytes from DB-rac1.localdomain (192.168.148.130): icmp_seq=5 ttl=64 time=0.041 ms
--- DB-rac1.localdomain ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4001ms
rtt min/avg/max/mdev = 0.041/0.075/0.209/0.067 ms
PING DB-rac2.localdomain (192.168.148.131) 56(84) bytes of data.
64 bytes from DB-rac2.localdomain (192.168.148.131): icmp_seq=1 ttl=64 time=2.16 ms
64 bytes from DB-rac2.localdomain (192.168.148.131): icmp_seq=2 ttl=64 time=0.385 ms
64 bytes from DB-rac2.localdomain (192.168.148.131): icmp_seq=3 ttl=64 time=0.268 ms
64 bytes from DB-rac2.localdomain (192.168.148.131): icmp_seq=4 ttl=64 time=0.370 ms
64 bytes from DB-rac2.localdomain (192.168.148.131): icmp_seq=5 ttl=64 time=0.170 ms
--- DB-rac2.localdomain ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4002ms
rtt min/avg/max/mdev = 0.170/0.671/2.162/0.749 ms
Remote host reachability check succeeded.
The following hosts are reachable: db-rac1 db-rac2.
The following hosts are not reachable: .
All hosts are reachable. Proceeding further...
firsthost db-rac1
numhosts 2
The script will setup SSH connectivity from the host db-rac1.localdomain to all
the remote hosts. After the script is executed, the user can use SSH to run
commands on the remote hosts or copy files between this host db-rac1.localdomain
and the remote hosts without being prompted for passwords or confirmations.
NOTE 1:
As part of the setup procedure, this script will use ssh and scp to copy
files between the local host and the remote hosts. Since the script does not
store passwords, you may be prompted for the passwords during the execution of
the script whenever ssh or scp is invoked.
NOTE 2:
AS PER SSH REQUIREMENTS, THIS SCRIPT WILL SECURE THE USER HOME DIRECTORY
AND THE .ssh DIRECTORY BY REVOKING GROUP AND WORLD WRITE PRIVILEDGES TO THESE
directories.
Do you want to continue and let the script make the above mentioned changes (yes/no)?
yes
The user chose yes
User chose to skip passphrase related questions.
Creating .ssh directory on local host, if not present already
Creating authorized_keys file on local host
Changing permissions on authorized_keys to 644 on local host
Creating known_hosts file on local host
Changing permissions on known_hosts to 644 on local host
Creating config file on local host
If a config file exists already at /home/oracle/.ssh/config, it would be backed up to /home/oracle/.ssh/config.backup.
Removing old private/public keys on local host
Running SSH keygen on local host with empty passphrase
Generating public/private rsa key pair.
Your identification has been saved in /home/oracle/.ssh/id_rsa.
Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.
The key fingerprint is:
31:36:f4:a8:d9:fb:95:a5:cb:2c:ad:0b:79:fc:88:4d oracle@db-rac1.localdomain
Creating .ssh directory and setting permissions on remote host db-rac1
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR oracle. THIS IS AN SSH REQUIREMENT.
The script would create ~oracle/.ssh/config file on remote host db-rac1. If a config file exists already at ~oracle/.ssh/config, it would be backed up to
~oracle/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host db-rac1.
Warning: Permanently added 'db-rac1,192.168.148.130' (RSA) to the list of known hosts.
oracle@db-rac1's password:
Done with creating .ssh directory and setting permissions on remote host db-rac1.
Creating .ssh directory and setting permissions on remote host db-rac2
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR oracle. THIS IS AN SSH REQUIREMENT.
The script would create ~oracle/.ssh/config file on remote host db-rac2. If a config file exists already at ~oracle/.ssh/config, it would be backed up to
~oracle/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host db-rac2.
Warning: Permanently added 'db-rac2,192.168.148.131' (RSA) to the list of known hosts.
oracle@db-rac2's password:
Done with creating .ssh directory and setting permissions on remote host db-rac2.
Copying local host public key to the remote host db-rac1
The user may be prompted for a password or passphrase here since the script would be using SCP for host db-rac1.
oracle@db-rac1's password:
Done copying local host public key to the remote host db-rac1
Copying local host public key to the remote host db-rac2
The user may be prompted for a password or passphrase here since the script would be using SCP for host db-rac2.
oracle@db-rac2's password:
Done copying local host public key to the remote host db-rac2
cat: /home/oracle/.ssh/known_hosts.tmp: No such file or directory
cat: /home/oracle/.ssh/authorized_keys.tmp: No such file or directory
SSH setup is complete.
------------------------------------------------------------------------
Verifying SSH setup
===================
The script will now run the date command on the remote nodes using ssh
to verify if ssh is setup correctly. IF THE SETUP IS CORRECTLY SETUP,
THERE SHOULD BE NO OUTPUT OTHER THAN THE DATE AND SSH SHOULD NOT ASK FOR
PASSWORDS. If you see any output other than date or are prompted for the
password, ssh is not setup correctly and you will need to resolve the
issue and set up ssh again.
The possible causes for failure could be:
1. The server settings in /etc/ssh/sshd_config file do not allow ssh
for user oracle.
2. The server may have disabled public key based authentication.
3. The client public key on the server may be outdated.
4. ~oracle or ~oracle/.ssh on the remote host may not be owned by oracle.
5. User may not have passed -shared option for shared remote users or
may be passing the -shared option for non-shared remote users.
6. If there is output in addition to the date, but no password is asked,
it may be a security alert shown as part of company policy. Append the
additional text to the <OMS HOME>/sysman/prov/resources/ignoreMessages.txt file.
------------------------------------------------------------------------
--db-rac1:--
Running /usr/bin/ssh -x -l oracle db-rac1 date to verify SSH connectivity has been setup from local host to db-rac1.
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note
that being prompted for a passphrase may be OK but being prompted for a password is ERROR.
Mon Feb 6 21:14:18 PST 2017
------------------------------------------------------------------------
--db-rac2:--
Running /usr/bin/ssh -x -l oracle db-rac2 date to verify SSH connectivity has been setup from local host to db-rac2.
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note
that being prompted for a passphrase may be OK but being prompted for a password is ERROR.
Mon Feb 6 21:14:19 PST 2017
------------------------------------------------------------------------
SSH verification complete.
[oracle@db-rac1 sshsetup]$
NOde2:-
[oracle@db-rac2 sshsetup]$ ./sshUserSetup.sh -user oracle -hosts "db-rac1 db-rac2" -noPromptPassphrase
The output of this script is also logged into /tmp/sshUserSetup_2017-02-06-21-14-42.log
Hosts are db-rac1 db-rac2
user is oracle
Platform:- Linux
Checking if the remote hosts are reachable
PING DB-rac1.localdomain (192.168.148.130) 56(84) bytes of data.
64 bytes from DB-rac1.localdomain (192.168.148.130): icmp_seq=1 ttl=64 time=0.589 ms
64 bytes from DB-rac1.localdomain (192.168.148.130): icmp_seq=2 ttl=64 time=0.317 ms
64 bytes from DB-rac1.localdomain (192.168.148.130): icmp_seq=3 ttl=64 time=0.367 ms
64 bytes from DB-rac1.localdomain (192.168.148.130): icmp_seq=4 ttl=64 time=0.288 ms
64 bytes from DB-rac1.localdomain (192.168.148.130): icmp_seq=5 ttl=64 time=0.390 ms
--- DB-rac1.localdomain ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4000ms
rtt min/avg/max/mdev = 0.288/0.390/0.589/0.106 ms
PING DB-rac2.localdomain (192.168.148.131) 56(84) bytes of data.
64 bytes from DB-rac2.localdomain (192.168.148.131): icmp_seq=1 ttl=64 time=0.107 ms
64 bytes from DB-rac2.localdomain (192.168.148.131): icmp_seq=2 ttl=64 time=0.166 ms
64 bytes from DB-rac2.localdomain (192.168.148.131): icmp_seq=3 ttl=64 time=0.040 ms
64 bytes from DB-rac2.localdomain (192.168.148.131): icmp_seq=4 ttl=64 time=0.039 ms
64 bytes from DB-rac2.localdomain (192.168.148.131): icmp_seq=5 ttl=64 time=0.040 ms
--- DB-rac2.localdomain ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4003ms
rtt min/avg/max/mdev = 0.039/0.078/0.166/0.051 ms
Remote host reachability check succeeded.
The following hosts are reachable: db-rac1 db-rac2.
The following hosts are not reachable: .
All hosts are reachable. Proceeding further...
firsthost db-rac1
numhosts 2
The script will setup SSH connectivity from the host db-rac2.localdomain to all
the remote hosts. After the script is executed, the user can use SSH to run
commands on the remote hosts or copy files between this host db-rac2.localdomain
and the remote hosts without being prompted for passwords or confirmations.
NOTE 1:
As part of the setup procedure, this script will use ssh and scp to copy
files between the local host and the remote hosts. Since the script does not
store passwords, you may be prompted for the passwords during the execution of
the script whenever ssh or scp is invoked.
NOTE 2:
AS PER SSH REQUIREMENTS, THIS SCRIPT WILL SECURE THE USER HOME DIRECTORY
AND THE .ssh DIRECTORY BY REVOKING GROUP AND WORLD WRITE PRIVILEDGES TO THESE
directories.
Do you want to continue and let the script make the above mentioned changes (yes/no)?
yes
The user chose yes
User chose to skip passphrase related questions.
Creating .ssh directory on local host, if not present already
Creating authorized_keys file on local host
Changing permissions on authorized_keys to 644 on local host
Creating known_hosts file on local host
Changing permissions on known_hosts to 644 on local host
Creating config file on local host
If a config file exists already at /home/oracle/.ssh/config, it would be backed up to /home/oracle/.ssh/config.backup.
Removing old private/public keys on local host
Running SSH keygen on local host with empty passphrase
Generating public/private rsa key pair.
Your identification has been saved in /home/oracle/.ssh/id_rsa.
Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.
The key fingerprint is:
7e:29:60:e1:c3:e0:53:18:e2:e5:59:49:9f:79:e8:db oracle@db-rac2.localdomain
Creating .ssh directory and setting permissions on remote host db-rac1
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR oracle. THIS IS AN SSH REQUIREMENT.
The script would create ~oracle/.ssh/config file on remote host db-rac1. If a config file exists already at ~oracle/.ssh/config, it would be backed up to
~oracle/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host db-rac1.
Warning: Permanently added 'db-rac1,192.168.148.130' (RSA) to the list of known hosts.
oracle@db-rac1's password:
Done with creating .ssh directory and setting permissions on remote host db-rac1.
Creating .ssh directory and setting permissions on remote host db-rac2
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR oracle. THIS IS AN SSH REQUIREMENT.
The script would create ~oracle/.ssh/config file on remote host db-rac2. If a config file exists already at ~oracle/.ssh/config, it would be backed up to
~oracle/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host db-rac2.
Warning: Permanently added 'db-rac2,192.168.148.131' (RSA) to the list of known hosts.
oracle@db-rac2's password:
Done with creating .ssh directory and setting permissions on remote host db-rac2.
Copying local host public key to the remote host db-rac1
The user may be prompted for a password or passphrase here since the script would be using SCP for host db-rac1.
oracle@db-rac1's password:
Done copying local host public key to the remote host db-rac1
Copying local host public key to the remote host db-rac2
The user may be prompted for a password or passphrase here since the script would be using SCP for host db-rac2.
oracle@db-rac2's password:
Done copying local host public key to the remote host db-rac2
cat: /home/oracle/.ssh/known_hosts.tmp: No such file or directory
cat: /home/oracle/.ssh/authorized_keys.tmp: No such file or directory
SSH setup is complete.
------------------------------------------------------------------------
Verifying SSH setup
===================
The script will now run the date command on the remote nodes using ssh
to verify if ssh is setup correctly. IF THE SETUP IS CORRECTLY SETUP,
THERE SHOULD BE NO OUTPUT OTHER THAN THE DATE AND SSH SHOULD NOT ASK FOR
PASSWORDS. If you see any output other than date or are prompted for the
password, ssh is not setup correctly and you will need to resolve the
issue and set up ssh again.
The possible causes for failure could be:
1. The server settings in /etc/ssh/sshd_config file do not allow ssh
for user oracle.
2. The server may have disabled public key based authentication.
3. The client public key on the server may be outdated.
4. ~oracle or ~oracle/.ssh on the remote host may not be owned by oracle.
5. User may not have passed -shared option for shared remote users or
may be passing the -shared option for non-shared remote users.
6. If there is output in addition to the date, but no password is asked,
it may be a security alert shown as part of company policy. Append the
additional text to the <OMS HOME>/sysman/prov/resources/ignoreMessages.txt file.
------------------------------------------------------------------------
--db-rac1:--
Running /usr/bin/ssh -x -l oracle db-rac1 date to verify SSH connectivity has been setup from local host to db-rac1.
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note
that being prompted for a passphrase may be OK but being prompted for a password is ERROR.
Mon Feb 6 21:15:12 PST 2017
------------------------------------------------------------------------
--db-rac2:--
Running /usr/bin/ssh -x -l oracle db-rac2 date to verify SSH connectivity has been setup from local host to db-rac2.
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note
that being prompted for a passphrase may be OK but being prompted for a password is ERROR.
Mon Feb 6 21:15:12 PST 2017
------------------------------------------------------------------------
SSH verification complete.
[oracle@db-rac2 sshsetup]$
[grid@db-rac1 sshsetup]$ ssh db-rac2 It is working from node 1 to node 2
[grid@db-rac2 ~]$ ssh db-rac1 It is working from node 2 to node 1
Last login: Sat Feb 11 04:03:43 2017
[grid@db-rac1 ~]$
No comments:
Post a Comment