SSH Connection
SSH Connection
[grid@racnode1 sshsetup]$ ./sshUserSetup.sh -user grid -hosts "racnode1 racnode2" -noPromptPassphrase -confirm -advanced
The output of this script is also logged into /tmp/sshUserSetup_2017-11-09-11-01-09.log
Hosts are racnode1 racnode2
user is grid
Platform:- Linux
Checking if the remote hosts are reachable
PING racnode1.data.in (192.168.71.141) 56(84) bytes of data.
64 bytes from racnode1.data.in (192.168.71.141): icmp_seq=1 ttl=64 time=0.038 ms
64 bytes from racnode1.data.in (192.168.71.141): icmp_seq=2 ttl=64 time=0.084 ms
64 bytes from racnode1.data.in (192.168.71.141): icmp_seq=3 ttl=64 time=0.086 ms
64 bytes from racnode1.data.in (192.168.71.141): icmp_seq=4 ttl=64 time=0.086 ms
64 bytes from racnode1.data.in (192.168.71.141): icmp_seq=5 ttl=64 time=0.084 ms
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)?
Confirmation provided on the command line
Creating keys on remote host racnode2 if they do not exist already. This is required to setup SSH on host racnode2.
Generating public/private rsa key pair.
Your identification has been saved in .ssh/id_rsa.
Your public key has been saved in .ssh/id_rsa.pub.
The key fingerprint is:
69:ee:c4:c5:36:3b:d8:a0:9c:7f:29:36:61:93:e6:2d [email protected]
The key's randomart image is:
+--[ RSA 1024]----+
| |
| |
| |
| o |
| S.= |
| . *** o |
| ++=++. |
| +E +. |
| .o= |
+-----------------+
Updating authorized_keys file on remote host racnode1
Updating known_hosts file on remote host racnode1
Updating authorized_keys file on remote host racnode2
Updating known_hosts file on remote host racnode2
cat: /home/grid/.ssh/known_hosts.tmp: No such file or directory
cat: /home/grid/.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 grid.
2. The server may have disabled public key based authentication.
3. The client public key on the server may be outdated.
4. ~grid or ~grid/.ssh on the remote host may not be owned by grid.
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.
------------------------------------------------------------------------
--racnode1:--
Running /usr/bin/ssh -x -l grid racnode1 date to verify SSH connectivity has been setup from local host to racnode1.
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.
Thu Nov 9 11:01:46 IST 2017
------------------------------------------------------------------------
--racnode2:--
Running /usr/bin/ssh -x -l grid racnode2 date to verify SSH connectivity has been setup from local host to racnode2.
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.
Thu Nov 9 11:01:46 IST 2017
------------------------------------------------------------------------
------------------------------------------------------------------------
Verifying SSH connectivity has been setup from racnode1 to racnode1
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.
bash: -c: line 0: unexpected EOF while looking for matching `"'
bash: -c: line 1: syntax error: unexpected end of file
------------------------------------------------------------------------
------------------------------------------------------------------------
Verifying SSH connectivity has been setup from racnode1 to racnode2
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.
bash: -c: line 0: unexpected EOF while looking for matching `"'
bash: -c: line 1: syntax error: unexpected end of file
------------------------------------------------------------------------
-Verification from complete-
SSH verification complete.
[grid@racnode1 sshsetup]$