I've set up my very first Ubuntu server and immediately logged in (as
myuser) to begin customizing it. I go to
/opt and run
mkdir: Cannot create directory 'sandbox' : Permission denied
Permission denied?!? Okay. So I run
sudo -i and enter
myuser's password. Re-run the
mkdir command, and voila! The directory is created. I log out.
I log back in as
myuser and navigate to
/opt and run
ls: nothing! No visible directories inside
So I sudo again with
sudo -i and re-run
ls. Now it sees
I think I'm missing some fundamental Linux knowledge with respect to users and roots. During the server configuration/installation, it asked me to create a user, which I did (
myuser). I assumed this would also be the root user (with full admin privs) since it was not only the user I created during installation, its the very first user in the system!
So why is it that
- Create directories outside of
- See directories created when in "sudo mode"
I'm also vague on the difference between
su and the
Ultimately, in addition to fully understanding these basics, I'd like to have a bunch of server software installed under
/opt/sandbox/ that can be running around the clock and interacting with the local filesystem. Now I'm not sure if I should be installing these applications while logged in simply as
myuser, sudoed as
myuser, or something else.
These servers are inside a secured, private home LAN so I don't need "real admin" and crazy security controls. I'm just setting up a simple dev enviroment for a small software tool I'm writing. Thanks in advance for any help with the questions above.