Cant login to server using filezilla as root to upload theme

Hi everyone,

I am really stuck I can’t login to server as root with filezilla or putty to upload my porto theme.

I followed Craig’s magento 2 from scratch installation video but when trying to log back in as root I camt do it.

I have tried logging in as my superuser I created and even sudo su root then change root password which allows me to do it but then when I go back to login again to filezilla as root it will not let me.

I have even tried on the digital ocean to reset root password, get a new one emailed go in again and enter new unix password which works but then still cant login in to filezilla or putty again as root afterwards.

Also I have gone onto phpmyadmin to make sure the superuser have full privileges but when logging into server as superuser through filezilla I cannot access all the root directories to upload my theme.

I’m so confused, any help or advice will be greatly appreciated?

Hi @Chris_Cordwell and welcome.

As you’ve been following the tutorial, this will make it nice and easy to answer as I can reference timestamps on the tutorial.

You should never upload any web files as “root”. The only purpose for using “root” is to create a “superuser”. There should never be a reason to use “root” ever again. If you recall, [14:11] into the tutorial you disabled the ability to log in as the “root” user. This is a standard security practice.

You should only be uploading files as the “magento” user (ref [35:47]). Otherwise, you will break your Permission/Owner/Group settings and Magento will not function correctly.

So, when you next log into Filezilla, simply use the username and password that you set in Chapter 3.

Note: If you’re unable to upload as the “magento” user then you missed a step during the Tutorial. If this does turn out to be the case then refer to the following Tutorial: How to diagnose and fix Ownerships and Permission issues

Hi Craig. According to your tutorial How to install Magento 2.4 and build a web server, User “craig” is superuser which is able to use superuser commands if required, user “magento” is owner of www server.

Can I understand that “craig” can be uploading any files outside /var/www/html/ and "magento can only be uploading web files to /var/www/html/ ?

@digitalstartup