SSH to Primary node...

dixie2000

New Member
May 16, 2023
29
1
3
First, I am sonewhat new to Proxmox and have limited Linux knowledge - That being said.

I need to be able to run a script on a VM that would SSH from that VM to the Proxmox primary node and issue a command to to reboot or shutdown the primary node as I need. The script side I can handle but getting the VM to connect to the node using a passphrase and not having to enter a password is my problem - not sure how to do this, any help is greatly appreciated!

Thanks, al
 
You are using "passphrase" and "password" interchangeably in your problem description, but they are two different things as far as SSH is concerned.
Passphrase protects your SSH key locally. To avoid typing it after initial session setup you can use SSH agent.
Password is your authentication method between hosts, if the SSH key is not setup between the hosts.

If your goal is to have a script driven by cron job, then your only option is to setup SSH key without a passphrase. Whether it suites your security profile, only you can decide.
If the script is run manually, then follow the many articles online that describe SSH/agent/key/passphrase setup. I.e. https://www.strongdm.com/blog/ssh-passwordless-login

Good luck


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
  • Like
Reactions: leesteken
Thanks for the response. Maybe a little more information would be helpful.

I am running NUT UPS (https://networkupstools.org/) on a VM. All works well and noifies me of any power issues. I want to take it a step further and if the UPS battery is almost depleted for the VM (via a script called by NUT) to connect to my PVE and PBS servers and shut them down gracefully.

I really don't want to install NUT on the PVE node itself.

Thanks...
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!