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.
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.
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.
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.