-1

I'm new to linux systems. I'm setting up an Ubuntu 14.04 server through AWS. I'm using their "ubuntu" user, which from my understanding should have all the permissions root does, but I get permission errors everywhere, requiring tons of "sudo". I'm particularly having trouble setting up virtualenvs.

Basic steps are

apt-get install python-pip
pip install virtualenv
virtualenv --python=/usr/bin/python3.4 venv_path
source venv_path/bin/activate
pip install django

But every command there seems to require pip or else it returns a Permission Denied. So when I install Django, I either get Permission Denied, or, if I use sudo, Django is installed into the global directory. Some people seem to say that's because I used sudo when creating the virtualenv, but, again, using the command without sudo returns Permission Denied error.

So what to do? How to get out of the permissions hell? Can post the specific Permission Denied for any given command if needed.

sybaritic
  • 392
  • 6
  • 15
  • 2
    Why are you asking here? This is a programming site. – Jay Riggs Dec 17 '14 at 00:59
  • in general 'sudo' has cost me a year of my life in debugging, i.e I forgot to type sudo, then something went wrong, something didn't work, .... 10 hrs go by, until I finally realize it was because I didn't type sudo.. Security comes at the expense of usability in this case. – kiwicomb123 Apr 21 '17 at 06:10

1 Answers1

2

The ubuntu user does not have root permissions without sudo, no. This is the way ubuntu recommends it.

As you've observed using sudo in a virtualenv does not work the way you'd expect it to. If you're creating a virtualenv somewhere that requires root access to modify, use su when you activate the virtualenv, like this

sudo su
source venv_path/bin/activate

su makes you the super user. Then all the commands you run in the virtualenv will be run with root permissions

pip install django

will work as expected.

khh
  • 196
  • 7