Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 982  / 1 Year ago, fri, may 12, 2023, 10:43:55

I have an existing setup as follows,
workstation <-> Maas server <-> VM's.



The Maas server has two interfaces, eth0 has a static address of 192.168.x.x and the eth1 has 10.4.x.x. eth1 is also acting as DHCP manager for the VM's. My workstation's ip is 10.x.x.x and I can ssh the Maas server. The Maas server in turn is also ssh connect to the VM's. Because the workstation and VM's are on a different network I can't connect to the VM's directly.



I tried reverse SSH tunneling with,



ssh -R 6333:localhost:22 [email protected] 


from one of the VM's to the Maas server. Afterwards I tried to connect from my workstation to the VM using,



ssh [email protected] -p 6333


But I repeatedly get this error, 'Permission denied (publickey).'



I have already copied my public key to in the VM's authorized key files, but I get same error. Is there maybe another method to connect from the workstation to the VM ! If so, please advise.


More From » ssh

 Answers
4

Let me suggest you to use sshuttle, it easily creates a 'vpn' over ssh in your workstation run the following commands:



$ sudo apt-get install sshuttle
$ sshuttle -r [email protected] 10.x.x.x/24 # /24 is the subnet


Then in another terminal (also in workstation) you should be able connect automagically to any host in 10.x.x.x/24 subnet.



I do this all the time, I really recommend you to use sshuttle.


[#22408] Saturday, May 13, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
fenddy

Total Points: 361
Total Questions: 103
Total Answers: 113

Location: Turkmenistan
Member since Sun, Aug 2, 2020
4 Years ago
;