Best practice for local environment

Locked
hercules
Posts: 2
Joined: Wed 12. Aug 2020, 11:46

Best practice for local environment

Post by hercules »

Hey,

I could not find anything directly relating to this via the search.

How do you guys usually go about setting up an environment locally for a single user? For example, if Composer and Node.js are needed for a certain website to run.

Do you activate SSH for the user and install it in the /username/www folder?

For me this does not appear to work and produces the following error message:

Code: Select all

Unable to create Composer 
home directory "/home/users/username/.config/composer": mkdir(): Permission denied
I checked the permissions and the user does not have the ‘w’ permission for its home directory.

Root accounts on the other hand have the necessary permissions for the home directory of the user but appear to be barred permission to enter the file children of the user’s directory.

So, do I need to temporarily alter permissions to perform the installation, even in case of using a root account? Or is there another way, a best practice for setting up a local environment while using keyhelp?

Since I am new to server administration and keyhelp, I am trying to get a grasp as to what the best practices are when using keyhelp together with the shell, especially to avoid unnecessarily fiddling around with permissions that are tailored to keyhelp.

Thanks for taking the time to read through this.

All the best,
hercules
User avatar
george
Posts: 87
Joined: Fri 3. Jan 2020, 05:53
Location: AUSTRALIA

Re: Best practice for local environment

Post by george »

Hello Hercules, this is Linux, you can do what you want. That is, if you know what you are doing.
In the KeyHelp documentation, most of the basics are covered:
https://kb.keyhelp.de/category.php

The way you describe SSH functions doesn't sound right.
Root should have full read-write access, and normal User should have same access to everything in /home/users/username.

Here are some tips to help get you going:

- Make sure in User Administration you have selected "SSH" capability for the user.
- Make sure of correct permissions for user's ssh:
/home/users/username/.ssh Permissions:700 = Owner:read-write-execute
- When needing to act as root, login as root. Root ssh is discouraged by many, but using an ssh-key and disabling password login makes for good security, in my opinion.
- Check the required permissions and access required by the applications you want to run. You may even need to do something like they do with Apache, that is, a different group:
www: owner = user / group = www-data

I know for /home/users/username/www directory, permissions are 750, with all sub-directories being permissions 755. The files contained within, are mostly permissions 644 - these are all standard. All sub-directories and files are owned by the User/Group.

Hope this gets you rolling...
hercules
Posts: 2
Joined: Wed 12. Aug 2020, 11:46

Re: Best practice for local environment

Post by hercules »

Thank you, @george! I changed the permissions by hand and now it is all working. Hope you will have a good one :)
Locked