How do I give SSH access to users for particular subdomains in cPanel - ssh

I am currently setting up a dev environment with multiple subdomains dom1.domain.net, dom2.domain.net, dom3.domain.net etc. and I would like to give different users SSH access to the individual subdomain directories in the file system. Some instances may allow more than one user access to the subdomain directory and some instances may allow one user to have access to multiple subdomain directories.
So, the question is: Is there a way for me to give multiple cPanel users SSH access per subdomain dir?
I tried to add a 'subdomain' account through WHM's 'Create account' but as expected it failed since the base domain already exists on the same server.
Anyone have any ideas? Point me in the right direction?
EDIT:
The reason for this setup is that I want to setup git for different subdomain enviroments and want to give users access only to the server projects directories they are concerned with.

If you have access to WHM you could just create individual cPanel accounts for each subdomains.
If you give access via SSH to a cpanel user, that user will have access to the main domain setup on the cPanel account and on all the subdomains created in that account. So in the end if you will have a cPanel user that can access 1-5-10 or whatever is the total of subdomains.
You can create multiple FTP accounts and associate them with subdomains but you won't be able to login via SSH with a FTP account.

Related

WHM - CPanel Cannoy rearrange account

Hello I have root access to my server through whm and I am trying to change the folder for one of the account domains. I researched and I think I have to rearrange the account so I went to rearrange the account section for that domain but it is not editable at all, how do I change the folder?
I'm not sure I quite understand your request but in order to do a rearrange of a cPanel account you need to do that from the WHM interface. In WHM you got to List Accounts, extend the cPanel account you want to re-arrange using the [+] sign and click on Change Disk Partition then select the new home partition for that account (could be /home, /home2 etc).

Point domain name to specific folder on server

I am currently working on a CMS type of site where users can create websites on my server.
I want to be able to create subdomains for the user's website for them to see the preview.
The next step would be for users to be able to point their domain name to my server, and when users go to the domain it would go to their own designated folder on my server.
How would I go about doing this automatically with php, I have been looking for solutions with no avail.
I currently have a Virtual Server with hostgator. Please advise, or point me in the right direction. Any solutions are welcome as well, I am pretty much stuck at this point.
Thank you very much.
EDIT
For example, if my domain is www.mydomain.com, when a user makes an account, the subdomain username.mydomain.com is created. Later down the line, if the user buys the domain name www.userdomain.com, I want to make it so that if www.userdomain.com is entered, it shows what is on www.mydomain.com/userdomain. The URL should still show www.userdomain.com
The answer is depends on which web server you are using ?(apache / nginx or any other)
You need to have separate directory for each sub domain you created
In your virtual host configuration you need to match the host name and get the subdomain as a parameter to set the root directory for your host name.
CNAME is also possible but if you can tell your web server there is a possibility for detailed answer.

Using DigitalOcean droplet/vserver with ISPConfig3 - access the sites by IP

My problem is that I'd like to be able to use temporary urls for my sites that are still in development phase. With cPanel i had this option:
create a new account (choose username, pass, etc.)
that account is assigned an IP
list all my accounts in the WHM, then click the IP showing for the account in question
a new tab opens, showing in the address bar sth like this: http://85.65.342.388/~username
That works just fine for my needs. So I wonder if something like that is possible having set up the following:
Digital Ocean cloud hosting - droplet created on Ubuntu
Installed Ispconfig3 to manage the server
one (not sure if single) server IP
I can visit my server IP - it opens the test website I uploaded to /var/www of the server when I just started testing the server (prior to installing Ispconfig)
Paths to my newly created accounts are:
/var/www/clients/client1/web1
/var/www/clients/client1/web2
/var/www/clients/client2/web1
etc...
Should I be able to access for example the website having its files in /var/www/clients/client1/web2 in a way that is similar to the above cPanel example?
There is an option in the Ispconfig to add server IPs but I'm unsure how to add them - because my droplet is showing a single IP and I don't see any spots to add additional IPs (in my Digital Ocean account interface).
Also my accounts (sites) have the option to select from predefined IP addresses (select box) but they come with only asterisk (*) shown as default.
Trying to set up new IP addresses via Ispconfig and then selecting one of them from Site's settings didn't help - nothing opens by visiting such an IP.

Giving permissions to a SQL Job to be able to access/modify folders and files on a different server

I have a sql job on SERVER01.
Part of the job is to access a folder located on a different server:
\\SERVER02\Files
I need to be able to create folders and files under it as well as modify/delete files.
The \\SERVER02\Files folder is being shared with several different accounts.
If I go to SERVER02 and try to UNC path to \\SERVER02\Files, it'll ask for a password.
Since the servers are in two different domains, I need to specify the domain for the account:
DOMAIN\accountName
password
Questions:
What is the correct way for me to set this up so that the job will have access to the other server so it can manipulate the files at \\SERVER02\Files ?
This is very confusing so I'm trying to get it right. Any help would be greatly appreciated.
Thanks.
We have this same issue in our own environment, because we have two domains that have to share resources. The technically correct solution is to setup a trust between the two domains so that user logins are mapped across the domains. If you're like us and can't setup a domain trust, you can try some of the following solutions:
Login under the account that the SQL job runs under on SERVER01, and use the Credential Manager to create a login to SERVER02 with the other domain's user / password.
Under the account that SQL job runs, create a network share to the UNC path with the credentials embedded: NET USE M: \\SERVER02\Files [password] /user:[domain\user]. You will have to make sure this path is always mapped before the job runs, and use M: for your path.
If you have a specific process/command you need to run that accesses the network path, you can start that particular process using runas to authenticate with the second domain's credentials: runas /netonly /user:[domain\user] "/path/to/mytask.exe". This prompts for the password, but that can be piped in with echo [password]|runas ...

Cannot change files permissions on server. Could this be because my site does not have a domain name?

I am developing a site for a client who has not decided on their domain name yet. I set up an account on a web server via WHM but have not pointed any domain names to it.
All was going well until I used a plugin (TinyMCE) to try and browse files on the server - it wouldnt work so I had a look at its script files and realised their permissions are set to not executable (644). I tired to change it to executable (755) but I get an error in my FTP clients console:
550 Could not change perms on file.js: Operation not permitted
Could this be because I am accessing the server not through a specific FTP account and so the server has locked down the files?
EG: I am using the servers IP address to access files with my FTP rather then something like:
ftp.mysite.com
Any advice on this would be great! Thanks
Yes, There is an issues with the FTP account permission. You will have to login your server with the main cPanel account user name and password OR you can chnage your file permission through cPanel >> File manager