2

I need to gain root access to a newly-created VM hosted on Microsoft Azure. This is done on FreePBX (running CentOS) by sending the keys Alt+F9 on the console and issuing the command !passwd root.

How can I send modifier keys to Azure's Serial Console?

Danny Beckett
  • 178
  • 3
  • 14

1 Answers1

2

You don't, because Alt+F9 is a keypress that only makes sense on the actual Linux framebuffer console. It switches to virtual terminal 9 on the real console. While it's possible to view the virtual machine's console using Boot Diagnostics, Azure doesn't allow sending keystrokes to the console. Therefore it is not possible to perform that action.

If you want to change the root password, you need to either log in with your normal user and sudo, or mount the virtual disk to another VM and edit its password (shadow) file from there.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
  • Thanks for your answer Michael, that all makes sense! It's a little frustrating that I can administer the server through FreePBX's web GUI but not via SSH. I guess this is a task for another time when the VM can be shutdown and mounted elsewhere. Many thanks! – Danny Beckett May 21 '19 at 02:47