[TUTORIAL] One liner alias to ssh into running containers from host (linux)

leodom

Renowned Member
Jul 25, 2015
10
1
68
Moorea Island
Since I got bored of having to type pct enter xxx each time,
I added an alias in .bashrc :
Bash:
alias p='PS3=" Which VM ? " ; select vm in $(pct list | grep running | sort -n | tr -s '\'' '\'' |  cut -d " " -f1,3 | tr '\'' '\'' .) ; do pct enter ${vm:0:3} ; break ; done'
Now, when I press p, I am presented with a numbered sorted list of all running containers to choose from :)
 
Thanks for sharing that. I marked the thread as tutorial.
 
  • Like
Reactions: leodom

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!