Results 1 to 6 of 6

Thread: How to recover root password linux

  1. #1
    Join Date
    Nov 2009
    Posts
    1,977

    How to recover root password linux

    Hi,
    I am not so expert on linux based operating system. The first thing I want to know is that how to recover the root password in it. If a use by accidentally forgets it the what are the possibilities to get it. Second things how can I add a partition to an existing directory. And the last thing I want to know how to run commands as root logged in as normal user.

  2. #2
    Join Date
    May 2008
    Posts
    2,680

    Re: How to recover root password linux

    There are several methods (including SUID), but I will mention here that the method sudo. Run the visudo command which will actually launch your favorite editor to edit the file / etc / sudo. You can then add the line: nom_utilisateur ALL=(ALL) NOPASSWD:ALL. The specified user can now execute commands reserved for root by typing: $ sudo command. The parameter "NOPASSWD" tells sudo it should request the password of the user before running the command.

  3. #3
    Join Date
    Jan 2008
    Posts
    3,388

    Re: How to recover root password linux

    It is not possible to recover the root password. But you can change this password if you have physical access to the computer. You must first find a way to access a console (using a live CD distribution like Knoppix, boot cd install linux, etc.). Then mount the root partition of your linux in a directory: # mount -t ext2 /dev/hda1 /mnt. Run the commands: # cd /mnt # chroot /mnt. It'll just change the password: # password root. Now you can restart linux and use your new password for root.

  4. #4
    Join Date
    May 2008
    Posts
    4,085

    Re: How to recover root password linux

    The problem is simple: no LVM and distribution increasingly tight, no way to resize the partitions so it creates another (on another disk or there's the place for example) and copy it to a large partition that takes up space as / usr. It starts in single mode init s. Creating a filesystem on the new partition + directory to copy the contents mkfs.ext3 /dev/hdxx mkdir -p /mnt/new_usr.

  5. #5
    Join Date
    Apr 2008
    Posts
    3,267

    Re: How to recover root password linux

    We mount the new partition and it copies the data on the new partition mount /dev/hdxx /mnt/new_usr cp -arf /usr/* /mnt/new_usr/. Adds good online fstab echo "/dev/hdxx /usr ext3 defaults 1 1" >> /etc/fstab. It removes what has been copied: attention better wait until you have verified that it works before making this manip 'delicate quque either partition rm -rf /usr/*.

  6. #6
    Join Date
    Apr 2008
    Posts
    3,522

    Re: How to recover root password linux

    The above process dismantles the partition that was created for the sole purpose of copying / usr (or our directory you climb that we just copy it and delete the directory / mnt created for the occasion umount /mnt/new_usr mount /usr rmdir /mnt/new_usr. It can restart the system or by a reboot or putting the usual runlevel reboot ( ou init X )

Similar Threads

  1. Setting root password in Linux Mint 10
    By hIMAVANT in forum Operating Systems
    Replies: 5
    Last Post: 23-09-2012, 11:47 AM
  2. How to setup Root password
    By DeepikaP in forum Operating Systems
    Replies: 4
    Last Post: 14-01-2011, 07:16 PM
  3. Want iphone root password.
    By KALLIYAN in forum Portable Devices
    Replies: 5
    Last Post: 05-01-2010, 05:13 AM
  4. My SQL Root Password Error
    By Aaryn in forum Software Development
    Replies: 2
    Last Post: 11-04-2009, 07:08 PM
  5. How to change the root password in linux
    By MATSU in forum Software Development
    Replies: 1
    Last Post: 03-12-2008, 01:59 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,908,652.54294 seconds with 16 queries