2

I have created a Vyatta virtual machine on my Hyper-V server, but I didn't enable ssh on that virtual machine. I want to connect to that machine without enabling the ssh and execute some shell commands using power shell. Is it possible to that? Is there any way to access that machine other than Hyper-V console?

Wesley
  • 32,320
  • 9
  • 80
  • 116
chinna2580
  • 109
  • 2
  • 4
  • 8
    You're asking how to park your car in the garage without touching the ground. Or using the car. Or owning a garage. – Wesley Dec 23 '15 at 07:24
  • i mean can i windows command line to enable the ssh on vyatta ,execute some shell commands using windows command line – chinna2580 Dec 23 '15 at 07:52
  • You need to enable remote access from within the virtual machine. – Wesley Dec 23 '15 at 08:01
  • Yes there are lots of ways of doing that, but most are insecure or require a large investment of effort. That's *why* everyone uses SSH. – symcbean Dec 25 '15 at 02:16

2 Answers2

8

[...] I didn't enable ssh on that virtual machine. I want to connect to that machine without enabling the ssh and execute some shell commands using power shell.

Your desire to connect remotely with a shell is completely at odds with your desire to disable remote services that offer a shell.

One way or another you have to enable a transport to carry shell communication. PowerShell does not run on Linux (whacky pet projects and implementations aside), and even if you did you'd need to enable the WinRM service, which is basically (broadly speaking), OpenSSH for Windows. If you've disabled SSH on the Linux machine there's no reason to believe you'd enable WinRM if it was theoretically available.

You have no option but to enable ssh or use the Hyper-V console.

Wesley
  • 32,320
  • 9
  • 80
  • 116
2

It sounds like you want console access to Vyatta without opening the ports necessary. If that's the real requirement, I think you should configure one of the virtual COM ports for the VM as a console. You'll need to configure this according to Vyatta's instructions. I'm not familiar with Vyatta, but I've done this with Ubuntu many times, as described here:

https://help.ubuntu.com/community/SerialConsoleHowto

Then you can either use PuTTY to connect to the named pipe from the virtual com port, or you can reflect it to a TCP port with this utility:

http://shvechkov.tripod.com/nptp.html

When you connect the COM port, I recommend COM2 within the VM. COM2 is, by default, configured in a way that works well for a terminal (instead of well for the NT kernel debugger.) In later versions of Hyper-V, you can configure the COM port by using the following PowerShell command. In earlier versions, COM2 is the only COM port that will work for you.

set-vmcomport -debuggermode off

Jake Oshins
  • 5,116
  • 17
  • 15