Grant SSH to subdomain via key?
Hi,
I have a VDS with root access. I don't have any account with shell access, except the main domain example.com, which is jailed. I have a key "mainkey" for it and can access via the accounts name "example".
I want to have a subdomain sub.example.com and allow special ssh access to only that part (subdomain) via ssh having a key "subkey" and possibly a separate login "sublogin" for that purpose. And also the "mainkey" with main account should be able to access it.
All I want to do is to enable some automated devices to reach that part of the server periodically and securely (for the server and for the connection)...
What is the best way to accomplish this?
Thank you...
-
Hi, Conceptually speaking, SSH can be enabled for user. You cannot get a separate SSH for a subdomain but only for main user and you can access all in this account through it.. However, if there is any specific requirement, the work around for this would to create a separate cPanel account for this subdomain.. 0 -
I'm not sure if I can create an account without a new domain name... Perhaps you are referring to scripts that I don't know anything about :/ Or playing with configuration files? What about creating a user in bash, giving rights to those directories and using ssh-keygen etc? Is it possible this way? 0 -
Hello, I recommend creating a separate cPanel account for the subdomain for this purpose. Otherwise, you'd have to setup a manual workaround like the one described at: restrict access based on SSH key Thank you. 0 -
OK, thank you... I found out that I could create an account for a subdomain in WHM, I didn't know that... 0 -
Hi, Glad you figure it out. Yes, you can create legitimate domain name that is fully qualified, even if it is a subdomain because subdomain is also a fully qualified domain and that is what I was referring too. 0
Please sign in to leave a comment.
Comments
5 comments