1

I am trying to create a file in "/" directory (which contains bin, boot , cdrom, dev, etc) but I am unable to do so. Although I am the one who install ubuntu and I am the root user? The error I get is of permission denied. When I used sudo it asks for password but I haven't set any password for it.

Also I cannot calculate the hash of a file in this directory.

I am sorry for my lame question as I just have switched to linux after using windows for long time.

1
  • Welcome to AskUbuntu. In all likelihood your user does not have permissions to write in that folder. Could you please post the output of the command ls -la / ? Dec 27, 2013 at 19:50

2 Answers 2

1

In Ubuntu most anything you do outside of your own home directory requires you to become a superuser, in other words to become Root, or to gain root privileges which are all the same.

Now with being root you will have a greater responsibility to keep your system in a stable state but also a very high risk to break it. Root can do anything including breaking your OS to a state where you will have to re-install Ubuntu as the only option remaining for repair.

There are only rare conditions where creating directories outside of /home/ may be needed. It certainly is not the way our understanding of the file system heirarchy is. In addition backups or a system reinstallation becomes harder with every single file residing outside of /home.

So if you are a beginner to the Ubuntu world I strongly advise you to not create directories or files outside of your home directory unless you really really know that you badly need them to be there, and your are 100% certain that there is no other solution.

0

It is file permissions, you can start a root shell with

 sudo bash

But be careful what you do. Also please note that, on Linux, you usally don't create dictionaries in the roor dir / - if you want to store files such as documents or photos, they should go in your home directory.

echo $HOME

will print the path of the current user's home directory to the shell.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .