Monday, June 1, 2015

Configure SSH for the new users created in RAC environment

Configure SSH for the new users created in RAC environment for the Database software installation.

The Oracle 11gR2 grid and database media includes a "sshsetup" directory containing a "sshUserSetup.sh" file.

[shoaib@e1vsr107 grid]$ cd sshsetup/

[shoaib@e1vsr107 sshsetup]$ ls -lrt
total 32
-rwxr-xr-x 1 oracle oinstall 31544 Apr 1 2009 sshUserSetup.sh

[shoaib@e1vsr107 sshsetup]$ ./sshUserSetup.sh -user shoaib -hosts "e1vsr107 e1vsr108" -noPromptPassphrase

The output of this script is also logged into /tmp/sshUserSetup_2015-05-24-23-37-39.log
Hosts are e1vsr107 e1vsr108
user is shoaib
Platform:- Linux

Checking if the remote hosts are reachable

PING E1vsr107.pathinfotech.com (192.168.15.107) 56(84) bytes of data.
64 bytes from E1vsr107.pathinfotech.com (192.168.15.107): icmp_seq=1 ttl=64 time=0.034 ms
64 bytes from E1vsr107.pathinfotech.com (192.168.15.107): icmp_seq=2 ttl=64 time=0.030 ms
64 bytes from E1vsr107.pathinfotech.com (192.168.15.107): icmp_seq=3 ttl=64 time=0.048 ms
64 bytes from E1vsr107.pathinfotech.com (192.168.15.107): icmp_seq=4 ttl=64 time=0.030 ms
64 bytes from E1vsr107.pathinfotech.com (192.168.15.107): icmp_seq=5 ttl=64 time=0.032 ms

--- E1vsr107.pathinfotech.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 3999ms
rtt min/avg/max/mdev = 0.030/0.034/0.048/0.010 ms

PING E1vsr108.pathinfotech.com (192.168.15.108) 56(84) bytes of data.
64 bytes from E1vsr108.pathinfotech.com (192.168.15.108): icmp_seq=1 ttl=64 time=0.369 ms
64 bytes from E1vsr108.pathinfotech.com (192.168.15.108): icmp_seq=2 ttl=64 time=0.334 ms
64 bytes from E1vsr108.pathinfotech.com (192.168.15.108): icmp_seq=3 ttl=64 time=0.312 ms
64 bytes from E1vsr108.pathinfotech.com (192.168.15.108): icmp_seq=4 ttl=64 time=0.300 ms
64 bytes from E1vsr108.pathinfotech.com (192.168.15.108): icmp_seq=5 ttl=64 time=0.375 ms

--- E1vsr108.pathinfotech.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4000ms
rtt min/avg/max/mdev = 0.300/0.338/0.375/0.029 ms
Remote host reachability check succeeded.
The following hosts are reachable: e1vsr107 e1vsr108.
The following hosts are not reachable: .
All hosts are reachable. Proceeding further...
The script will setup SSH connectivity from the host e1vsr107.pathinfotech.com 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 e1vsr107.pathinfotech.com
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/shoaib/.ssh/config, it would be backed up to /home/shoaib/.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/shoaib/.ssh/id_rsa.
Your public key has been saved in /home/shoaib/.ssh/id_rsa.pub.
The key fingerprint is:
95:5a:65:83:a3:d6:72:19:7f:99:52:c6:b1:5b:8d:8e shoaib@e1vsr107.pathinfotech.com

Creating .ssh directory and setting permissions on remote host e1vsr107
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR shoaib. THIS IS AN SSH REQUIREMENT.
The script would create ~shoaib/.ssh/config file on remote host e1vsr107. If a config file exists already at ~shoaib/.ssh/config, it would be backed up to ~shoaib/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host e1vsr107.
Warning: Permanently added 'e1vsr107,192.168.15.107' (RSA) to the list of known hosts.
shoaib@e1vsr107's password:
Done with creating .ssh directory and setting permissions on remote host e1vsr107.

Creating .ssh directory and setting permissions on remote host e1vsr108
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR shoaib. THIS IS AN SSH REQUIREMENT.
The script would create ~shoaib/.ssh/config file on remote host e1vsr108. If a config file exists already at ~shoaib/.ssh/config, it would be backed up to ~shoaib/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host e1vsr108.
Warning: Permanently added 'e1vsr108,192.168.15.108' (RSA) to the list of known hosts.
shoaib@e1vsr108's password:
Done with creating .ssh directory and setting permissions on remote host e1vsr108.

Copying local host public key to the remote host e1vsr107
The user may be prompted for a password or passphrase here since the script would be using SCP for host e1vsr107.
shoaib@e1vsr107's password:
Done copying local host public key to the remote host e1vsr107

Copying local host public key to the remote host e1vsr108
The user may be prompted for a password or passphrase here since the script would be using SCP for host e1vsr108.
shoaib@e1vsr108's password:
Done copying local host public key to the remote host e1vsr108

cat: /home/shoaib/.ssh/known_hosts.tmp: No such file or directory
cat: /home/shoaib/.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 shoaib.
2. The server may have disabled public key based authentication.
3. The client public key on the server may be outdated.
4. ~shoaib or ~shoaib/.ssh on the remote host may not be owned by shoaib.
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 /sysman/prov/resources/ignoreMessages.txt file.
------------------------------------------------------------------------
--e1vsr107:--
Running /usr/bin/ssh -x -l shoaib e1vsr107 date to verify SSH connectivity has been setup from local host to e1vsr107.
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.
Sun May 24 23:38:58 IST 2015
------------------------------------------------------------------------
--e1vsr108:--
Running /usr/bin/ssh -x -l shoaib e1vsr108 date to verify SSH connectivity has been setup from local host to e1vsr108.
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.
Sun May 24 23:38:59 IST 2015
------------------------------------------------------------------------
SSH verification complete.
[shoaib@e1vsr107 sshsetup]$

No comments:

Post a Comment

ORA-12519: TNS:no appropriate service handler found error

ORA-12519: TNS: no appropriate service handler found error The real problem lies in the PROCESSES parameter All you need ...