I am starting a web hosting company and there are a few details that I have yet to figure out, one of them being some sort of SSH VPN to connect to our servers running CentOS 6 with cPanel.
So this is what I am looking to do...
1) Have a master server with specific user logins (user1, user2, etc.) for my employees. In order to SSH into any of our servers, they would all need to login to this master server first.
2) From this master server, they will be able to ssh server.example.com
and the master server would be able to log them right in as root.
What I know needs to be done is generating a key pair for each user and putting their private key in the /root/.ssh/authorized_keys
file on each server. I already have means to update this file automatically for each server using cron.
I can get all of that to work, but sometimes the login gets a bit screwy and I also have a problem with the connection timing out after about 15 minutes. I believe I have an idea to fix that, but any help would be appreciated.
Now, for the main question here, I want to be able to have users login using a short hostname or the prefix of the hostname instead of having to type out the entire thing when logging into a server. So if I have a server with the hostname s1.server.example.com
, they will be able to use s s1.server
(s will be aliased to ssh) for a quick login. I'm not positive how to do this, but if there is an easy way without needing to setup each and every server on the master server to have it's short name point to the full hostname, it would be a lot easier to maintain in the future. I'm guessing that some type of script could be written to check for the correct hostname that goes to the prefix would be needed.
Any bit of direction would be greatly appreciated here, I have tried so many different solutions without avail and would rather is work correctly without a whole bunch of "hacks" like I have been doing. Thank you!
EDIT
I wanted to update everyone here as I think I was pretty unclear. This system is only accessible by higher-level employees within the company in order to provide a quick and easy way to manage our cloud systems via root. Customers will not have access to these systems and any customers who may have root with their services, with be using direct root access.