SSH connection without password between two Azure VMs
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
0
down vote
favorite
SSH connection without password between two Azure VMs
I have two RHEL7 VMs running in the same resource group with the same subscription ID.
I have assigned DNS names to them;
master.eastus.cloudapp.azure.com and
node.eastus.cloudapp.azure.com
The ips are dynamically assigned by Azure
These VMs are setup for a manual installation of OpenShift which requires two VMs and will need to communicate with ssh, no password
Both VMs are on the same subnet:
subnet Virtual network/subnet: openshift-vm-vnet/default
I have set up two Network Interface Inbound rules for each vm-vnet/default
Master :: internal ip 10.0.0.3
name port protocol Source Destination Action
default -allow-ssh 22 TCP <Corp ip> Any Allow
node_vm 22 TCP 10.0.0.0/29 Any Allow
Node :: internal ip 10.0.0.4
name port protocol Source Destination Action
default -allow-ssh 22 TCP <Corp ip> Any Allow
master_vm 22 TCP 10.0.0.0/29 Any Allow
I am able to connect to both of the the VMs using the domains with windows 10 v 1 power shell.ssh -v rhel7@avantiadev.eastus.cloudapp.azure.com
When connected to the VM in powershell, I am unable to connect to the other VM with the domain.
trying to connect to a domain from a windows 10 power shell connected to a VM instance times out
[rhel7@master ~]$ ssh -v rhel7@node.eastus.cloudapp.azure.com
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug1: Connecting to node.eastus.cloudapp.azure.com [public ip] port 22.
debug1: connect to address [public ip] port 22: Connection timed out
ssh: connect to host node.eastus.cloudapp.azure.com port 22: Connection timed out
I am able to connect using the internal ip. 10.0.0.x
ssh-keygen has been run on both VMinstances:ssh-keygen -t rsa -b 2048
(No password entered)
with keys created in ~/.ssh/id_rsa.pub
on each VM.
When trying to copy the key from the master to the nodessh-copy-id -i ~/.ssh/id_rsa.pub rhel7@node.eastus.cloudapp.azure.com
The connection times out.
using the internal ip address is successful.ssh-copy-id -i ~/.ssh/id_rsa.pub 10.0.0.3
successfully transferred the id_rsa.pub key value to the server.
Logging in to the server >ssh 10.0.0.3 still requires a password
How do I configure two azure vms for ssh passwordless connections so they will be able to communicate as a part of the Openshift installation process?
ssh azure
add a comment |Â
up vote
0
down vote
favorite
SSH connection without password between two Azure VMs
I have two RHEL7 VMs running in the same resource group with the same subscription ID.
I have assigned DNS names to them;
master.eastus.cloudapp.azure.com and
node.eastus.cloudapp.azure.com
The ips are dynamically assigned by Azure
These VMs are setup for a manual installation of OpenShift which requires two VMs and will need to communicate with ssh, no password
Both VMs are on the same subnet:
subnet Virtual network/subnet: openshift-vm-vnet/default
I have set up two Network Interface Inbound rules for each vm-vnet/default
Master :: internal ip 10.0.0.3
name port protocol Source Destination Action
default -allow-ssh 22 TCP <Corp ip> Any Allow
node_vm 22 TCP 10.0.0.0/29 Any Allow
Node :: internal ip 10.0.0.4
name port protocol Source Destination Action
default -allow-ssh 22 TCP <Corp ip> Any Allow
master_vm 22 TCP 10.0.0.0/29 Any Allow
I am able to connect to both of the the VMs using the domains with windows 10 v 1 power shell.ssh -v rhel7@avantiadev.eastus.cloudapp.azure.com
When connected to the VM in powershell, I am unable to connect to the other VM with the domain.
trying to connect to a domain from a windows 10 power shell connected to a VM instance times out
[rhel7@master ~]$ ssh -v rhel7@node.eastus.cloudapp.azure.com
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug1: Connecting to node.eastus.cloudapp.azure.com [public ip] port 22.
debug1: connect to address [public ip] port 22: Connection timed out
ssh: connect to host node.eastus.cloudapp.azure.com port 22: Connection timed out
I am able to connect using the internal ip. 10.0.0.x
ssh-keygen has been run on both VMinstances:ssh-keygen -t rsa -b 2048
(No password entered)
with keys created in ~/.ssh/id_rsa.pub
on each VM.
When trying to copy the key from the master to the nodessh-copy-id -i ~/.ssh/id_rsa.pub rhel7@node.eastus.cloudapp.azure.com
The connection times out.
using the internal ip address is successful.ssh-copy-id -i ~/.ssh/id_rsa.pub 10.0.0.3
successfully transferred the id_rsa.pub key value to the server.
Logging in to the server >ssh 10.0.0.3 still requires a password
How do I configure two azure vms for ssh passwordless connections so they will be able to communicate as a part of the Openshift installation process?
ssh azure
1
I think yoursshd_config
file has a restriction on what IP range can connect to the VM. Plus within the same network, your VMs are working how it supposed to work. You should not need to go to WAN network in order to connect to a VM on the LAN network.
â Praveen P
Feb 8 at 20:05
When you say Logging in to the server >ssh 10.0.0.3 still requires a password are you runningssh 10.0.0.3
? In that case is the public of the current machine on theauthorized_keys
file of theroot
on 10.0.0.3?
â Praveen P
Feb 8 at 20:10
Thanks Praveen. The sshd_config hasn't been modified. I don't see a setting that would restrict IPs. I'm ssh-ing to the master 10.0.0.4 from windows 10 with windows power shell. Once connected to the master I am ssh-ing to node 10.0.0.3 from the master. 'ssh 10.0.0.3'. 10.0.0.3 /home/rhel7/.ssh auhtorized_keys includes the ssh-rsa key for the rhel7 user of the master. known_hosts includes a entry for the master: 10.0.0.4 ecdsa-sha2-nistp256. I believe this will be an issue as the ip is dynamic.
â Mike T
Feb 9 at 20:38
10.0.0.3 /etc/ssh does not include any authorized_key or known_host files /root does not have a .ssh dir or authorized_keys file.
â Mike T
Feb 9 at 20:38
Your config seems to be fine. When you say IP is dynamic, did you mean the 10.0.0.3 could be something else tomorrow?
â Praveen P
Feb 9 at 20:42
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
SSH connection without password between two Azure VMs
I have two RHEL7 VMs running in the same resource group with the same subscription ID.
I have assigned DNS names to them;
master.eastus.cloudapp.azure.com and
node.eastus.cloudapp.azure.com
The ips are dynamically assigned by Azure
These VMs are setup for a manual installation of OpenShift which requires two VMs and will need to communicate with ssh, no password
Both VMs are on the same subnet:
subnet Virtual network/subnet: openshift-vm-vnet/default
I have set up two Network Interface Inbound rules for each vm-vnet/default
Master :: internal ip 10.0.0.3
name port protocol Source Destination Action
default -allow-ssh 22 TCP <Corp ip> Any Allow
node_vm 22 TCP 10.0.0.0/29 Any Allow
Node :: internal ip 10.0.0.4
name port protocol Source Destination Action
default -allow-ssh 22 TCP <Corp ip> Any Allow
master_vm 22 TCP 10.0.0.0/29 Any Allow
I am able to connect to both of the the VMs using the domains with windows 10 v 1 power shell.ssh -v rhel7@avantiadev.eastus.cloudapp.azure.com
When connected to the VM in powershell, I am unable to connect to the other VM with the domain.
trying to connect to a domain from a windows 10 power shell connected to a VM instance times out
[rhel7@master ~]$ ssh -v rhel7@node.eastus.cloudapp.azure.com
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug1: Connecting to node.eastus.cloudapp.azure.com [public ip] port 22.
debug1: connect to address [public ip] port 22: Connection timed out
ssh: connect to host node.eastus.cloudapp.azure.com port 22: Connection timed out
I am able to connect using the internal ip. 10.0.0.x
ssh-keygen has been run on both VMinstances:ssh-keygen -t rsa -b 2048
(No password entered)
with keys created in ~/.ssh/id_rsa.pub
on each VM.
When trying to copy the key from the master to the nodessh-copy-id -i ~/.ssh/id_rsa.pub rhel7@node.eastus.cloudapp.azure.com
The connection times out.
using the internal ip address is successful.ssh-copy-id -i ~/.ssh/id_rsa.pub 10.0.0.3
successfully transferred the id_rsa.pub key value to the server.
Logging in to the server >ssh 10.0.0.3 still requires a password
How do I configure two azure vms for ssh passwordless connections so they will be able to communicate as a part of the Openshift installation process?
ssh azure
SSH connection without password between two Azure VMs
I have two RHEL7 VMs running in the same resource group with the same subscription ID.
I have assigned DNS names to them;
master.eastus.cloudapp.azure.com and
node.eastus.cloudapp.azure.com
The ips are dynamically assigned by Azure
These VMs are setup for a manual installation of OpenShift which requires two VMs and will need to communicate with ssh, no password
Both VMs are on the same subnet:
subnet Virtual network/subnet: openshift-vm-vnet/default
I have set up two Network Interface Inbound rules for each vm-vnet/default
Master :: internal ip 10.0.0.3
name port protocol Source Destination Action
default -allow-ssh 22 TCP <Corp ip> Any Allow
node_vm 22 TCP 10.0.0.0/29 Any Allow
Node :: internal ip 10.0.0.4
name port protocol Source Destination Action
default -allow-ssh 22 TCP <Corp ip> Any Allow
master_vm 22 TCP 10.0.0.0/29 Any Allow
I am able to connect to both of the the VMs using the domains with windows 10 v 1 power shell.ssh -v rhel7@avantiadev.eastus.cloudapp.azure.com
When connected to the VM in powershell, I am unable to connect to the other VM with the domain.
trying to connect to a domain from a windows 10 power shell connected to a VM instance times out
[rhel7@master ~]$ ssh -v rhel7@node.eastus.cloudapp.azure.com
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug1: Connecting to node.eastus.cloudapp.azure.com [public ip] port 22.
debug1: connect to address [public ip] port 22: Connection timed out
ssh: connect to host node.eastus.cloudapp.azure.com port 22: Connection timed out
I am able to connect using the internal ip. 10.0.0.x
ssh-keygen has been run on both VMinstances:ssh-keygen -t rsa -b 2048
(No password entered)
with keys created in ~/.ssh/id_rsa.pub
on each VM.
When trying to copy the key from the master to the nodessh-copy-id -i ~/.ssh/id_rsa.pub rhel7@node.eastus.cloudapp.azure.com
The connection times out.
using the internal ip address is successful.ssh-copy-id -i ~/.ssh/id_rsa.pub 10.0.0.3
successfully transferred the id_rsa.pub key value to the server.
Logging in to the server >ssh 10.0.0.3 still requires a password
How do I configure two azure vms for ssh passwordless connections so they will be able to communicate as a part of the Openshift installation process?
ssh azure
ssh azure
edited Feb 8 at 23:32
Praveen P
1286
1286
asked Feb 8 at 19:41
![](https://i.stack.imgur.com/q2fUv.png?s=32&g=1)
![](https://i.stack.imgur.com/q2fUv.png?s=32&g=1)
Mike T
1
1
1
I think yoursshd_config
file has a restriction on what IP range can connect to the VM. Plus within the same network, your VMs are working how it supposed to work. You should not need to go to WAN network in order to connect to a VM on the LAN network.
â Praveen P
Feb 8 at 20:05
When you say Logging in to the server >ssh 10.0.0.3 still requires a password are you runningssh 10.0.0.3
? In that case is the public of the current machine on theauthorized_keys
file of theroot
on 10.0.0.3?
â Praveen P
Feb 8 at 20:10
Thanks Praveen. The sshd_config hasn't been modified. I don't see a setting that would restrict IPs. I'm ssh-ing to the master 10.0.0.4 from windows 10 with windows power shell. Once connected to the master I am ssh-ing to node 10.0.0.3 from the master. 'ssh 10.0.0.3'. 10.0.0.3 /home/rhel7/.ssh auhtorized_keys includes the ssh-rsa key for the rhel7 user of the master. known_hosts includes a entry for the master: 10.0.0.4 ecdsa-sha2-nistp256. I believe this will be an issue as the ip is dynamic.
â Mike T
Feb 9 at 20:38
10.0.0.3 /etc/ssh does not include any authorized_key or known_host files /root does not have a .ssh dir or authorized_keys file.
â Mike T
Feb 9 at 20:38
Your config seems to be fine. When you say IP is dynamic, did you mean the 10.0.0.3 could be something else tomorrow?
â Praveen P
Feb 9 at 20:42
add a comment |Â
1
I think yoursshd_config
file has a restriction on what IP range can connect to the VM. Plus within the same network, your VMs are working how it supposed to work. You should not need to go to WAN network in order to connect to a VM on the LAN network.
â Praveen P
Feb 8 at 20:05
When you say Logging in to the server >ssh 10.0.0.3 still requires a password are you runningssh 10.0.0.3
? In that case is the public of the current machine on theauthorized_keys
file of theroot
on 10.0.0.3?
â Praveen P
Feb 8 at 20:10
Thanks Praveen. The sshd_config hasn't been modified. I don't see a setting that would restrict IPs. I'm ssh-ing to the master 10.0.0.4 from windows 10 with windows power shell. Once connected to the master I am ssh-ing to node 10.0.0.3 from the master. 'ssh 10.0.0.3'. 10.0.0.3 /home/rhel7/.ssh auhtorized_keys includes the ssh-rsa key for the rhel7 user of the master. known_hosts includes a entry for the master: 10.0.0.4 ecdsa-sha2-nistp256. I believe this will be an issue as the ip is dynamic.
â Mike T
Feb 9 at 20:38
10.0.0.3 /etc/ssh does not include any authorized_key or known_host files /root does not have a .ssh dir or authorized_keys file.
â Mike T
Feb 9 at 20:38
Your config seems to be fine. When you say IP is dynamic, did you mean the 10.0.0.3 could be something else tomorrow?
â Praveen P
Feb 9 at 20:42
1
1
I think your
sshd_config
file has a restriction on what IP range can connect to the VM. Plus within the same network, your VMs are working how it supposed to work. You should not need to go to WAN network in order to connect to a VM on the LAN network.â Praveen P
Feb 8 at 20:05
I think your
sshd_config
file has a restriction on what IP range can connect to the VM. Plus within the same network, your VMs are working how it supposed to work. You should not need to go to WAN network in order to connect to a VM on the LAN network.â Praveen P
Feb 8 at 20:05
When you say Logging in to the server >ssh 10.0.0.3 still requires a password are you running
ssh 10.0.0.3
? In that case is the public of the current machine on the authorized_keys
file of the root
on 10.0.0.3?â Praveen P
Feb 8 at 20:10
When you say Logging in to the server >ssh 10.0.0.3 still requires a password are you running
ssh 10.0.0.3
? In that case is the public of the current machine on the authorized_keys
file of the root
on 10.0.0.3?â Praveen P
Feb 8 at 20:10
Thanks Praveen. The sshd_config hasn't been modified. I don't see a setting that would restrict IPs. I'm ssh-ing to the master 10.0.0.4 from windows 10 with windows power shell. Once connected to the master I am ssh-ing to node 10.0.0.3 from the master. 'ssh 10.0.0.3'. 10.0.0.3 /home/rhel7/.ssh auhtorized_keys includes the ssh-rsa key for the rhel7 user of the master. known_hosts includes a entry for the master: 10.0.0.4 ecdsa-sha2-nistp256. I believe this will be an issue as the ip is dynamic.
â Mike T
Feb 9 at 20:38
Thanks Praveen. The sshd_config hasn't been modified. I don't see a setting that would restrict IPs. I'm ssh-ing to the master 10.0.0.4 from windows 10 with windows power shell. Once connected to the master I am ssh-ing to node 10.0.0.3 from the master. 'ssh 10.0.0.3'. 10.0.0.3 /home/rhel7/.ssh auhtorized_keys includes the ssh-rsa key for the rhel7 user of the master. known_hosts includes a entry for the master: 10.0.0.4 ecdsa-sha2-nistp256. I believe this will be an issue as the ip is dynamic.
â Mike T
Feb 9 at 20:38
10.0.0.3 /etc/ssh does not include any authorized_key or known_host files /root does not have a .ssh dir or authorized_keys file.
â Mike T
Feb 9 at 20:38
10.0.0.3 /etc/ssh does not include any authorized_key or known_host files /root does not have a .ssh dir or authorized_keys file.
â Mike T
Feb 9 at 20:38
Your config seems to be fine. When you say IP is dynamic, did you mean the 10.0.0.3 could be something else tomorrow?
â Praveen P
Feb 9 at 20:42
Your config seems to be fine. When you say IP is dynamic, did you mean the 10.0.0.3 could be something else tomorrow?
â Praveen P
Feb 9 at 20:42
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1004331%2fssh-connection-without-password-between-two-azure-vms%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
I think your
sshd_config
file has a restriction on what IP range can connect to the VM. Plus within the same network, your VMs are working how it supposed to work. You should not need to go to WAN network in order to connect to a VM on the LAN network.â Praveen P
Feb 8 at 20:05
When you say Logging in to the server >ssh 10.0.0.3 still requires a password are you running
ssh 10.0.0.3
? In that case is the public of the current machine on theauthorized_keys
file of theroot
on 10.0.0.3?â Praveen P
Feb 8 at 20:10
Thanks Praveen. The sshd_config hasn't been modified. I don't see a setting that would restrict IPs. I'm ssh-ing to the master 10.0.0.4 from windows 10 with windows power shell. Once connected to the master I am ssh-ing to node 10.0.0.3 from the master. 'ssh 10.0.0.3'. 10.0.0.3 /home/rhel7/.ssh auhtorized_keys includes the ssh-rsa key for the rhel7 user of the master. known_hosts includes a entry for the master: 10.0.0.4 ecdsa-sha2-nistp256. I believe this will be an issue as the ip is dynamic.
â Mike T
Feb 9 at 20:38
10.0.0.3 /etc/ssh does not include any authorized_key or known_host files /root does not have a .ssh dir or authorized_keys file.
â Mike T
Feb 9 at 20:38
Your config seems to be fine. When you say IP is dynamic, did you mean the 10.0.0.3 could be something else tomorrow?
â Praveen P
Feb 9 at 20:42