[PVE-User] ssh access with private key

Emmanuel Kasper e.kasper at proxmox.com
Wed Feb 24 10:27:37 CET 2016


On 02/23/2016 05:35 PM, Mohamed Sadok Ben Jazia wrote:
> Hello list,
> I use proxmox pve API to create LXC containers with a chosen root password
> for ssh access and it's working well.
> I'm asking if it's possible to let the CT owner use it's private key
> instead of root password, and this with an automatic way, using the api or
> other methods.
> Note that i don't need to add this private key
> to /root/.ssh/authorized_keys. I need a way to make a user add it's private
> key from a webinterface.
> Can i make this possible.
> Thank you guys
> 
> 
> 
> _______________________________________________
> pve-user mailing list
> pve-user at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-user
> 

Hi Mohamed

Beware users have to put their *public* key in .ssh/authorized_keys

It's not possible to upload ssh keys at the momment via the API. The use
case is understandable but it's not sure if the API should cover every
possible case of  container configuration ( though patches welcome !)

Note it might be also to do this 'pct exec' which allows the host to
execute commands directly in the container
for instance

pct exec 142 cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support/"
BUG_REPORT_URL="https://bugs.debian.org/"

You could try to script around this.

Emmanuel





More information about the pve-user mailing list