Announcement

Collapse
No announcement yet.

'/etc/hosts'

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    '/etc/hosts'

    I was trying to figure out a supposed network issue (connection kept dropping after about 10 secs on my works ntwk), and I was trying to remove some info I thought was for my home network. Instead, I managed to kill sudo and all networking. I found the file I need to repair (/etc/hosts), but without sudo, I cant enter root to edit. I really don't want to reload. What else can I try?

    Thanks in advance.

    #2
    Re: '/etc/hosts'

    Using reall IP-addresses instead of host names?

    Comment


      #3
      Re: '/etc/hosts'

      Hence "Supposed" I thought I had pulled the host name of my access piont when I was reconfiguring/enabling the wireless. Just squealing the tires on the learning curve. Any idea how to get around the missing sudo?

      Comment


        #4
        Re: '/etc/hosts'

        I can't understand your question.

        1. you want to correct your sudo problem ?
        2. you want to fix your network ?
        3. you want to do something with /etc/hosts ?
        cheers!
        -=|From the desk of|=-
        «•´`•.(*•.¸(`•.¸ ¸.•´)¸.•*).•´`•»
        «•´¨*•.¸¸whoiam55.¸¸.•*¨`•»
        «•´`•.(¸.•´(¸.•* *•.¸)`•.¸).•´`•»
        Reg. Linux User # 400637

        Comment


          #5
          Re: '/etc/hosts'

          Hi,

          Rather than start a new post for the same issue I'll post my question on this thread. I have exactly the same problem. While troubleshooting a networking issue I commented out the following two lines at the top of the my /etc/hosts file:

          # 127.0.0.1 localhost mypc localhost.localdomain
          # 127.0.1.1 mypc


          The result of commenting out these two lines prevented sudo from functioning correctly. When I attempt to execute sudo I get an error that sudo is unable to lookup the hostname 'mypc'. Also, once I restarted my PC my network no longer comes up on eth0 for the same reason.

          Since sudo is no longer functioning I can't go back into my /etc/hosts file and uncomment these two lines. A warning above these lines such as 'modifying or commenting out these lines will make bad things happen and you will suffer" would have been useful.

          Does anyone know how I can get in and uncomment these two lines in my /etc/hosts file (or replace my /etc/hosts file) without the use of sudo? I might add that I have not enabled my root account, so that option is out.

          Thanks in advance for any ideas anyone might have.

          John

          Comment


            #6
            Re: '/etc/hosts'

            Try using a live cd to edit /etc/hosts.

            Comment


              #7
              Re: '/etc/hosts'

              Thanks for the tip WifeIsOrc. I loaded up my knoppix 4.0.2 Live CD, mounted my kubuntu partition rw, su'ed to root, edited my /etc/hosts file and everything is good now.

              That was too easy and kinda scary. Anyone who can get physical access to my PC for more than 5 minutes and has a Linux Live CD can have their way with it. Yikes!!!

              Comment


                #8
                Re: '/etc/hosts'

                Originally posted by jcridge
                That was too easy and kinda scary. Anyone who can get physical access to my PC for more than 5 minutes and has a Linux Live CD can have their way with it. Yikes!!!
                Off on a tangent here.

                A thought: if this is really a concern, couldn't you change your computer's boot order in BIOS so that it wouldn't boot from the CD drive, and then set a BIOS password to protect the boot order from being tampered with?

                Comment


                  #9
                  Re: '/etc/hosts'

                  Yes you can, but if someone has physical access to your computer, it's always the easiest way to hack it, even if you added password to bios and changed order of boot devices...

                  Comment

                  Working...
                  X