[grid@node1 scripts]$ /u01/app/21.0.0.0/grid/oui/prov/resources/scripts/sshUserSetup.sh -user grid  -hosts "node1 node2" -noPromptPassphrase -confirm -advanced
The output of this script is also logged into /tmp/sshUserSetup_2024-06-21-12-23-06.log
Hosts are node1 node2
user is grid
Platform:- Linux
Checking if the remote hosts are reachable
PING node1.localdomain (192.168.1.71) 56(84) bytes of data.
64 bytes from node1.localdomain (192.168.1.71): icmp_seq=1 ttl=64 time=0.016 ms
64 bytes from node1.localdomain (192.168.1.71): icmp_seq=2 ttl=64 time=0.027 ms
64 bytes from node1.localdomain (192.168.1.71): icmp_seq=3 ttl=64 time=0.038 ms
64 bytes from node1.localdomain (192.168.1.71): icmp_seq=4 ttl=64 time=0.026 ms
64 bytes from node1.localdomain (192.168.1.71): icmp_seq=5 ttl=64 time=0.038 ms

--- node1.localdomain ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4102ms
rtt min/avg/max/mdev = 0.016/0.029/0.038/0.008 ms
PING node2.localdomain (192.168.1.72) 56(84) bytes of data.
64 bytes from node2.localdomain (192.168.1.72): icmp_seq=1 ttl=64 time=0.382 ms
64 bytes from node2.localdomain (192.168.1.72): icmp_seq=2 ttl=64 time=0.483 ms
64 bytes from node2.localdomain (192.168.1.72): icmp_seq=3 ttl=64 time=0.498 ms
64 bytes from node2.localdomain (192.168.1.72): icmp_seq=4 ttl=64 time=0.615 ms
64 bytes from node2.localdomain (192.168.1.72): icmp_seq=5 ttl=64 time=0.395 ms

--- node2.localdomain ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4093ms
rtt min/avg/max/mdev = 0.382/0.474/0.615/0.087 ms
Remote host reachability check succeeded.
The following hosts are reachable: node1 node2.
The following hosts are not reachable: .
All hosts are reachable. Proceeding further...
firsthost node1
numhosts 2
The script will setup SSH connectivity from the host node1.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 node1.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 PRIVILEGES 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

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/grid/.ssh/config, it would be backed up to /home/grid/.ssh/config.backup.
Creating .ssh directory and setting permissions on remote host node1
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR grid. THIS IS AN SSH REQUIREMENT.
The script would create ~grid/.ssh/config file on remote host node1. If a config file exists already at ~grid/.ssh/config, it would be backed up to ~grid/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host node1.
Warning: Permanently added 'node1,192.168.1.71' (ECDSA) to the list of known hosts.
grid@node1's password:
Done with creating .ssh directory and setting permissions on remote host node1.
Creating .ssh directory and setting permissions on remote host node2
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR grid. THIS IS AN SSH REQUIREMENT.
The script would create ~grid/.ssh/config file on remote host node2. If a config file exists already at ~grid/.ssh/config, it would be backed up to ~grid/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host node2.
Warning: Permanently added 'node2,192.168.1.72' (ECDSA) to the list of known hosts.
Done with creating .ssh directory and setting permissions on remote host node2.
Copying local host public key to the remote host node1
The user may be prompted for a password or passphrase here since the script would be using SCP for host node1.
grid@node1's password:
Done copying local host public key to the remote host node1
Copying local host public key to the remote host node2
The user may be prompted for a password or passphrase here since the script would be using SCP for host node2.
Done copying local host public key to the remote host node2
Creating keys on remote host node1 if they do not exist already. This is required to setup SSH on host node1.

Creating keys on remote host node2 if they do not exist already. This is required to setup SSH on host node2.

Updating authorized_keys file on remote host node1
Updating known_hosts file on remote host node1
Updating authorized_keys file on remote host node2
Updating known_hosts file on remote host node2
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 /sysman/prov/resources/ignoreMessages.txt file.
------------------------------------------------------------------------
--node1:--
Running /usr/bin/ssh -x -l grid node1 date to verify SSH connectivity has been setup from local host to node1.
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.
Fri Jun 21 12:23:29 -03 2024
------------------------------------------------------------------------
--node2:--
Running /usr/bin/ssh -x -l grid node2 date to verify SSH connectivity has been setup from local host to node2.
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.
Fri Jun 21 12:23:29 -03 2024
------------------------------------------------------------------------
------------------------------------------------------------------------
Verifying SSH connectivity has been setup from node1 to node1
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.
Fri Jun 21 12:23:30 -03 2024
------------------------------------------------------------------------
------------------------------------------------------------------------
Verifying SSH connectivity has been setup from node1 to node2
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.
Fri Jun 21 12:23:30 -03 2024
------------------------------------------------------------------------
-Verification from complete-
SSH verification complete.
[grid@node1 scripts]$

hostgator