LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how do I run from root (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-i-run-from-root-524446/)

repairshop 01-31-2007 01:54 PM

how do I run from root
 
I am new to linux, I ama using fedora 6. I can not create a new folder because I am not running as an administrator. I just downloaded this Os not to long ago, and I am currently running under a user name I created @localhost:
Thanks

macemoneta 01-31-2007 02:07 PM

You do not need to be root to create a folder, unless you are trying to create it in a portion of the filesystem that does not belong to your userid. Not knowing that, you may want to read a few tutorials befor you use the root (administrator) account, as that can be very destructive to your system.

To answer your question, you can become root with the command:

su - root

You will be prompted for the root password, which your established during the installation process.

b0uncer 01-31-2007 02:13 PM

Try to do stuff as the regular user you created, only use root account when it's absolutely necessary. This usually prevents fatal accidents and possibly creates a bit more security, when root login is not open (should a security breach happen, it's not hopefully as fatal in a regular user account than with root privileges). Anyway, to become root temporiraly:

Code:

su
it asks for the root password (the one you entered during setup), and after that you're logged in as root (remember: this way, when you are acutally logged in as a regular user, the $PATH variable is not the same as root user's, so for some programs you need to specify full path, for example /sbin/fdisk instead of fdisk). A (hopefully) more secure, and one you should learn to use, is sudo. With sudo one can give limited (i.e. only certain commands, only for certain users) root privileges for a given user, and no root password need be revealed. For this you usually need to add the desired user into sudoers group (edit /etc/group file) and then add a line to /etc/sudoers that lets that user (or a group where the desired users belong to) use sudo command -- there you can also specify what commands that user can access with root privileges, and if (user's) password is needed (it should be). After these two things are set, you can then
Code:

sudo /sbin/fdisk
for example; this time the user's own password is asked, and after that the given command is run as root; after the command finishes, you are back to your regular account, so no root account is left 'open' if the command suddenly dies.

Note: when typing passwords, usually no letters are shown on screen. Everything is written though it's not displayed.

repairshop 02-01-2007 08:13 AM

Still every time I try to creat a folder it still tells me that permition was denied.
When I first installed Fedora, I don't remember creating a password for root. I only created the one user. I was thinking about going back and download it again, may be this time I know what to look for.
Thanx, for the info.

farslayer 02-01-2007 08:30 AM

It would be easier to provide help if we knew the command you were using and the directory you were trying to do it in... i.e.

Quote:

username@itg-debian:~$ pwd
/home/username

username@itg-debian:~$ mkdir /test
mkdir: cannot create directory `/test': Permission denied

The above example does not work because we are trying to create the 'test' directory under the root file system .. had we issued the command mkdir test it would have worked because we would have then created /home/username/test instead of trying to create the directory /test as in the original example.

The first does not work because you are trying to create a directory in the root file system which a normal user does not have rights to, while in the second example the directory is being created in the users home directory.

repairshop 02-01-2007 09:03 AM

Excellent, that is exactly what I was trying to do.now I understand how it works.
Thanks a lot!

pixellany 02-01-2007 09:18 AM

There should be an award for newbies that have the patience to work things out and then actually say "thank you".....

Glad we could help---give us a harder one next time...;)


All times are GMT -5. The time now is 12:28 PM.