38,760
edits
(Updating to match new version of source page) |
(Updating to match new version of source page) |
||
Line 50: | Line 50: | ||
* Béluga: robot.beluga.alliancecan.ca | * Béluga: robot.beluga.alliancecan.ca | ||
* Narval: robot.narval.alliancecan.ca | * Narval: robot.narval.alliancecan.ca | ||
* Niagara: robot.niagara.alliancecan.ca | * Niagara: robot.niagara.alliancecan.ca (you may also use robot1.niagara.alliancecan.ca or robot2.niagara.alliancecan.ca directly, one is the fallback for the other) | ||
= Using the right key = | = Using the right key = | ||
Line 73: | Line 73: | ||
{{Command|ssh robot /usr/bin/ls}} | {{Command|ssh robot /usr/bin/ls}} | ||
{{Command|rsync -a datadir/a robot:scratch/testdata}} | {{Command|rsync -a datadir/a robot:scratch/testdata}} | ||
= IPv4 vs IPv6 issue = | |||
When connecting to the robot node the SSH client on your computer may choose to use the '''IPv6 addressing''' over the older '''IPv4'''. | |||
This seems to be more probably in Windows environment. | |||
If this is the case you have to make sure that the IP address mask you put in the <code>restrict,from=</code> field of the key | |||
matches the type your computer will be using when connecting to the node. | |||
You can check your addresses using this web site: https://test-ipv6.com/ . | |||
* An IPv4 address would look like '''199.241.166.5'''. | |||
* An IPv6 address could be similar to '''2620:123:7002:4::5'''. | |||
The possible problem is that if you put the IPv4 address mask, '''199.241.166.*''' into the CCDB SSH key, and | |||
your SSH client will be connecting the the robot node using IPv6 address, the source address will not match the mask in the key | |||
and the key will not be accepted by the robot node. | |||
=== How to identify the problem === | |||
If you are having difficulties to make the SSH connection to a robot node working. | |||
Try this test command: | |||
ssh -i ~/.ssh/automation_key -vvv username@robot.graham.alliancecan.ca "ls -l" | |||
This command tries to connect to the robot node on Graham cluster and execute the <code>ls -l</code> command | |||
using the <code>~/.ssh/automation_key</code> SSH key. | |||
Then it prints the list of files in your home directory on Graham to screen. | |||
This command will produce a lot of debug output due to the <code>-vvv</code> option (be Very Very Verbose). | |||
Look for the '''Connecting to...''' message there. | |||
If it says something like this: | |||
debug1: Connecting to robot.graham.alliancecan.ca [199.241.166.5] port 22. | |||
it means the IPv4 is being used. | |||
If the message is similar to | |||
debug1: Connecting to robot.graham.alliancecan.ca [2620:123:7002:4::5] port 22. | |||
then IPv6 is being used to make the connection. | |||
=== Possible solutions === | |||
* You can make the SSH client to '''explicitly use either IPv4 or IPv6''' using the <code>-4</code> and <code>-6</code> options, respectively, to match the format you used for the key in CCDB. | |||
* You can try using an '''IP address instead of the name''' to point to the robot node. Using Graham example, try using the | |||
: <code>ssh -i ~/.ssh/automation_key -vvv username@199.241.166.5 "ls -l"</code> | |||
: instead, to force SSH to use the IPv4 addresses. | |||
* You can try to '''disable the IPv6 addressing''' for your system, to make sure that only IPv4 is used. | |||
: Currently, there should not be any negative impact on your system. | |||
: How to disable IPv6 will depend on your system and the operating system. | |||
= Automation using Python and Paramiko = | = Automation using Python and Paramiko = |