Find the answer to your Linux question:
Results 1 to 7 of 7
Hello, Can anybody help me? Im a total newbie and I accidentally commented root user in the /etc/passwd. NOw I could no longer SSH to the server because the command ...
  1. #1
    Just Joined!
    Join Date
    Mar 2007
    Posts
    4

    commented root user at /etc/passwd

    Hello,

    Can anybody help me? Im a total newbie and I accidentally commented root user in the /etc/passwd.

    NOw I could no longer SSH to the server because the command "su -" gives me:

    su: user root does not exist

    I guess Im messed up here.

    Karen

  2. #2
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    boot up from any LiveCD, mount partition OR boot up in rescue mode and remove comment sign.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  3. #3
    Just Joined!
    Join Date
    Mar 2007
    Posts
    4

    Smile

    Thanks for that very quick reply, devils_casper.

    How do I mount partition? Will I not lose any data or files in mounting? When I type df -h, I get the following:

    Filesystem Size Used Avail Use% Mounted on
    /dev/hda1 4.9G 206M 4.4G 5% /
    none 121M 0 121M 0% /dev/shm
    /dev/hda6 7.9G 786M 6.8G 11% /home
    /dev/hda3 9.7G 1.5G 7.8G 16% /usr
    /dev/hda2 9.7G 5.3G 4.0G 58% /var

    Also, How can I boot up in a rescue mode?

    I appreciate your help, really.

  4. #4
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    How do I mount partition? Will I not lose any data or files in mounting?
    you wont loose any data. which linux distro do you have?
    do you have any LiveCD?
    for mounting any partition, execute this
    Code:
    mkdir first
    mount -t <filesystem> /dev/<partition> first
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  5. #5
    Just Joined!
    Join Date
    Mar 2007
    Posts
    4
    when I typed cat/proc/version, it gave me:

    Linux version 2.6.9-42.ELsmp (buildcentos@build-i386) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-3)) #1 SMP Sat Aug 12 09:39:11 CDT 2006


    Forgive my ignorance, but i dont know what to replace in the <partition> area. When you say,
    mount -t <filesystem> /dev/<partition> first

    do you mean, I have to type (as actual):
    mount -t /dev/hda1 /dev/root first

  6. #6
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    mount -t <filesystem> /dev/<partition> first
    replace <filesystem> with the actual filesystem in which you have formated partition. ext3, vfat for FAT32, ntfs for NTFS etc.

    i asume that root partition (/dev/hda1) is formated in ext3 file system. execute this
    Code:
    mkdir first
    mount -t ext3 /dev/hda1 first
    cd first/etc
    nano passwd
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  7. #7
    Just Joined!
    Join Date
    Mar 2007
    Posts
    4
    Oh, ok I finally got it understood. I just have to finish downloading the LiveCD and Im all set.

    Thanks for your help devils_casper!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...