ssh upload www folder

ssh upload www

Ssh upload www. Note this article is for Debian based Linux distributions.

Several web designing tools offer ssh or sftp uploads to your site folder. Normally your user (if using a regular user) doesn’t have access to the /var/www folder. Unless you are using the root user, and that is not recommended. Remote root login should be blocked.

For ssh upload www we first need to change the folder permissions to 775. The reason for that is because we want to give groups access to write and modify files in the www folder. To change the folder permissions we do: sudo chmod -R 775 /var/www/

Note: the command above will also change the permissions in all sub-folders of www. If you only want to set 775 to the www without sub-folders, just remove -R. In most cases that will be enough as your software will create the folders it needs. And inherit the permissions from www.

Next we will need to add our user to the group www-data. That is the group used by the webserver. Doesn’t mater if you use Apache or Nginx, it will still use www-data. Here is how to add your user til www-data: sudo usermod -a -G www-data john

Here we are assuming the user is called John. Usermod means modify user. Then we are using two parameters. The first one -a means append (to supplementary groups and is always used together with -g).
The second one -G means groups. You can list more than one group. We only listed www-data. But you could list a whole list of groups. Use comma to separate them if you want to list more than one group.
Third parameter is the group(s) we want to add to the user.
Finally, the fourth parameter, is the name of the user we want to modify.

That is all on ssh upload www topic. Enjoy!

Happy uploading!

About Author

Related Posts

php8 gd

PHP8 gd Activate after installation

PHP8 GD activate after installation. GD doesn’t get activated by default. Not even a reboot after installation will activate it. So how do we do it? In…

wordpress page not found

WordPress page not found after changing permalinks

Permalinks are a critical aspect of a WordPress website’s structure, providing user-friendly URLs that enhance both SEO and user experience. However, occasionally, WordPress users encounter permalink issues…

Debian 12: linux-image-6.1.0-10amd64

Troubleshooting dependency issues in Debian 12: Resolving linux-image-6.1.0-10amd64 package dependency problems. If you installed the Debian 12 from the live image the issue is the raspi-firmware. Even…

4 Best Free Nas Software That Is Open Source

Free NAS software or operating systems that are free to use and will turn a computer into a NAS more advanced than the dedicated boxes sold. What…

Raspbian default password

Raspbian default password

Looking for the Raspbian default password? It is the most essential username and password that you will need for your raspberry. At least if you are running…

OpenMediaVault default password

OpenMediaVault default password

OpenMediaVault default password is printed in the documentation. I did not see it the first time I installed it either. So I had to do some detective…

Leave a Reply