43 comment

    1. its simple and very easy. just type the command “passwd” space the “username.”
      then enter it will ask for new password… tats it..
      SYNTAX: [[email protected] ~]# passwd root
      Changing password for user root.
      New UNIX password:
      BAD PASSWORD: it is based on a dictionary word
      Retype new UNIX password:
      passwd: all authentication tokens updated successfully.

      “tats it”

    1. Yes you can create another account who will have the same power as root user,
      It very much simple in most of Linux OS.
      User the command ,
      #useradd -ou 0 vikas
      #passwd vikas

      After this user(vikas) will work as root user

  1. when installing Linux the system will not let you create a user called “root” because it already exists. You can create a user like localadmin or use your own name. Give it a password then after the installation is finished you can change root’s password by typing sudo passwd root
    it asks you for new password twice. and then after that you can log in as root.
    you can always change users password by using sudo passwd username. but if you want to be root you have to log in as yourself then do a su
    then put roots password in. after that you wont have to sudo every time.
    it is all for your benefit because you dont want to re-format and reinstall every time you make a mistake (as root) it is too dangerous.

  2. I am a new user of linux OS Ubuntu and am trying to login as root. I can’t do so because I don’t know the root password. I was only asked for one password on installation and that does not work with root. Can someone help?

  3. OK I am new too so experts can correct me if I am wrong!…but this is my experience…. the ubuntu 8.04 workstation version and gdm (the gnue GUI/windows) will not allow you to log in as root or privileged user…but before that when you first log in, use whatever name you created to get in the system.
    then if you are in the GUI open up a terminal (comand line) and do a
    sudo passwd root
    and set a password for the root user.
    then you can either use the command su to get in as root or login as root (before you get in the GUI).
    The root is automatically created when you install the system but it is not activated until you setup a password for it.
    you have to be patient bcs the first time you have to put your password whenever you use sudo then after that you’ll enter root’s new password twice then after that its easy bcs whenever you login as root you only use the new password once.

    You can use xdm instead of gdm to be able to log in as the root. gdm/kdm will not allow you to do that tho.
    any way root user is too dangerous.. it has precedence even over the operating system so be careful with it.

  4. To satisfy both the security problems and your wish to have your own unique root user:

    usermod –login newusername root

    This changes the root user to whatever you want AND strengthens the security at the same time as noone can brute force the COMMON root user anymore. In order you add a DUPLICATE “root” user and sustain the same permissions, you must change the account to –non-unique so that two accounts can share the uid “0” and gid “0”. Linux is ignoring me when I use this command and I don’t know why; so, for now just change the login name. Please post if you figure out how to get linux to accept the –non-unique using usermod command.

  5. Thanks Johnakabean;

    I did not know about usermod command.
    I know tho the only GUI program that actually allows you to log on as root is xdm.
    kdm and other xwindows prog. like gdm will not allow root to log in.

  6. actually my friend has created rootuser while installing but after two days i want to change that .Thatswhy i went to first system settings i changed the password like user name :jyotshna,password:jyotshna. Now iam not able to enter in to system throughlike super user.while iam trying do that it is showing root is changed as home directory .

  7. First, as an infosec professional I completely agree with the additional security benefits and best practices SUDO provides.

    However, the self-proclaimed experts who repeatedly belch forth the tired “I-know-how-but-I’m-not-going-to-tell-you-so-go-learn-SUDO-&-sudoers” mantra are the same individuals who post explicit command-line configurations for complex OS & service installations or modifications INCLUDING THE SUDO command, without considering that newbies are simply copying & pasting these commands into their installations without understanding ANY of the risks or the increased attack surface the changes may be creating. Such behavior creates MORE security issues than sharing the information to allow a user to create alternate root accounts.

    **Before using the following commands, it is your responsibility to understand the ramifications of creating and using a root-level account. Use may result in a security compromised system or you may render your system COMPLETELY UNUSABLE.

    ** You agree by using the information contained herein that any negative impact or results to any system, data or network are entirely your responsibility.

    Create additional root-level accounts by running these commands from a terminal session:

    > sudo su
    > useradd -G root
    > passwd
    > id
    (you should see something similar to: uid=1001(newusername) gid=1001(newusername) groups=0(root)
    > usermod -o -u 0 -g 0
    (in the usermod command string, the first switch is the letter “O”. The characters following the -u and -g switches are each “zero”)
    > id
    (now you should see something similar to: uid=0(root) gid=0(root) groups=0(root)

    I suggest bouncing your system prior to logging on with the newly created root-level user account.

    > shutdown -r now

    These commands work well in most main stream *nix and BSD distributions. Use them wisely.

  8. I have a problem in regards to root. I have a windows virus in linux weird but true! the problem is it’s in root on my linux distro and i’m sure its using wine to activate the virus. Would i need to worry as it can’t move around like in windows. Can’t do anything with it do you have any ideas?

  9. Oh BTW, if this is the first time you set up linux what you can do is to log in as regular user (bcs it will not allow you to create root at the install, since its already there…) then do a passwd root to set a new password for the root, then you can log on as root user or do the su or sudo commands.

    Darkrift2012 has an excellent post above as well.

  10. Root is a secret….

    Because PC’s have a 99% chance of getting physically stolen where cruel punishment can take place, which could include:

    1. Drop from a 3rd story window
    2. Electrify your cat Squiggles while its taking a bath
    3. Mysterious strangers using your backspace key as if its a pound key repeatedly
    4. Because grany loves peaking at your special artwork
    5. Because being root makes you feel important
    6. Aunt Jemima and her secret service of highly trained ninjas

  11. i want to create a new user in fedora linux
    but that permission was denied while using the command USERADD.
    how to grant the permission to create a new user?
    please its urgent

  12. did you use sudo before useradd?
    or as I do I just type in su and then the password then I get the new shell which I am the root, then I can do whatever. then I type exit to get out of root and go back to my user.

Leave a Comment