Generating ssh private key on virtual server creation

4 posts / 0 new
Last post
#1 Thu, 07/08/2010 - 00:28
shinji

Generating ssh private key on virtual server creation

Is there any way to have VirtualMin create a private key upon virtual server creation? I configured it to only allow private key authentication to connect via ssh but I would like to be able to have their private keys generated as needed with new accounts if possible. I don't mind generating them manually but it would help if it is streamlined a little bit more.

P.S. - I've got nearly everything setup (finally). Hopefully I don't need to do this all over again as it was a pain to get everything just right. Mail was the worst thing to configure.

Thu, 07/08/2010 - 08:44
andreychek

Howdy,

You may want to look into the settings in System Settings -> Server Templates -> Default -> Actions Upon User and Server Creation -> Command to run after making changes to a server.

Using that, you can have it execute a script of some sort that would generate the keys that you're after.

-Eric

Thu, 07/08/2010 - 10:16 (Reply to #2)
shinji

Thanks. I'll look into that for sure.

EDIT: BTW, That's in Module Config not in Server Templates. I've enabled module configuration because I enabled auto private key generation elsewhere and it wasn't activating. I'll try it later to see if it works.

EDIT: Hmm... That didn't work. Guess I will need to write a script or resort to doing it manually (i.e. have them generate their own with their program then add the public key for them) -- actually they could do that themselves using FTP now that I think about it. :p

Mon, 12/19/2016 - 20:07
Francewhoa
Francewhoa's picture

On the more recent Webmin version 1.8*. Part of that can be easily automated. One of the settings page is located at Webmin > Servers > SSH Server > User SSH Key Setup

This page allows you to configure the automatic setup of SSH for new Unix users created on your system. If configured, new users will not have to run ssh-keygen before using SSH.

Related documentation at http://doxfer.webmin.com/Webmin/SSH_Server

- - -
Senior Product Manager, and Co-Founder at Ubertus.org Inc.
Love back your Virtualmin & Webmin community

Topic locked