New 'user' doesn't have same permissions as 'root'

October 31, 2013 10k views
I've followed the tutorial on setting up a LAMP stack on my VPS and it would seem the new user DOESN'T have the same privileges as root, therefore I'm not able to change and files, folders, create and new files or folders etc... any help much appreciated.
9 Answers
If you want to modify files in /var/www/domain, you can simple change its ownership to your user:
sudo chown -R youruser:youruser /var/www

That will give your user write access to all of the directories/files in /var/www.
Check out How To Use Filezilla to Transfer and Manage Files Securely on your VPS.

Also, make sure that your /var/www directory is owned by www-data:www-data; by executing, in a terminal,
ls -la

If it's anything but, execute:
sudo chown -R www-data:www-data /var/www

Also, make sure that your user is part of the www-data:www-data group, by executing:
sudo usermod -a -G www-data username
by Pablo Carranza
This article will teach you how to use Filezilla to transfer and manage files securely on your VPS.
Did you implement Step Four of Initial Server Setup with Ubuntu 12.04?
by Etel Sverdlov
This tutorial covers how to login with root, how to change the root password, how to create a new user, how to give the new user root privileges, how to change the port, and how to disable root login in. This tutorial is written for Ubuntu. When you first create your server, this tutorial explains the first steps you need to take. This tutorial is written for Ubuntu 12.04.
And even if you have implemented step four you still need to run the command with 'sudo' in order to gain root privileges.
#sudo mv directory /home/user/targetdirectory
#sudo shutdown -h now
sudo nano /etc/sudoers
add your username
Followed the steps to the letter, and already added user ALL=(ALL:ALL) ALL to the above, still causing me some issues.
So sudo mkdir ~/test does not work for you?

Have you tried rebooting your droplet?

Remember that with Linux, names are case sensitive.
Using terminal yes that's possible, but there's two factors there.

1. I'm in /home/user/
2. I'm using terminal rather than ftp app like transmit

The reason I want to use SFTP is because I do a lot of work with Expression Engine and need to be able to just upload files.

Could I just put my domain folders that are being pointed at in /home/user/domain etc, if so is that a complicated task changing where things point to. I'm fairly new to all of this.
Just to add to above, currently my sites are in /var/www/domain/
Have another answer? Share your knowledge.