0

I'm working on ubuntu 14.04. I cant login to my pc as a root user.I tried different ways and i cant still the issue.

If i give sudo command the response is like

> ubuntu@ubuntu72:~$ sudo su
sudo: unable to resolve host ubuntu72
[sudo] password for ubuntu: 

Then i tried the command to get host details nano /etc/hoststhe response is

*127.0.0.1       localhost
127.0.1.1       ubuntu-Invalid-entry-length-0-DMI-table-is-broken-Stop

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters




                [ Read 9 lines (Warning: No write permission) ]
^G Get Help  ^O WriteOut  ^R Read File ^Y Prev Page ^K Cut Text  ^C Cur Pos
^X Exit      ^J Justify   ^W Where Is  ^V Next Page ^U UnCut Text^T To Spell
*

I need to edit this line to solve this issue , i'm unable to edit this line

127.0.1.1       ubuntu-Invalid-entry-length-0-DMI-table-is-broken-Stop

How can i edit this line how can i edit i tried this ways.

->1

   `ubuntu@ubuntu72:~$ sudo -i gedit /etc/hosts
    sudo: unable to resolve host ubuntu72
    [sudo] password for ubuntu: 

->2

ubuntu@ubuntu72:~$ chattr -i /etc/hosts
chattr: Permission denied while setting flags on /etc/hosts

->3

By command gedit /etc/hosts i'm able to open the hosts file .I cant change permissions

 ubuntu@ubuntu72:/$ chmod 777 -R /etc/hosts
chmod: changing permissions of ‘/etc/hosts’: Operation not permitted

`How can i edit this /etc/hosts to fix this issue? Is there any way to fix this issue?

  • What does hostname say? For some reason your shell thinks your hostname is ubuntu72, but /etc/hosts thinks it is ubuntu-Invalid-entry-length-0-DMI-table-is-broken-Stop. Did you recently change the hostname? – psusi Sep 11 '18 at 17:24
0

just edit your /etc/hosts, and add

127.0.0.1 ubuntu72

saved and change permissions

sudo chmod 644 hosts

and change your owned

sudo chown root:root -R host

restart with type sudo init 6

Hope this helps.

  • the command chmod & chown is not working here i mentioned that in the question. Is there any other way? – crackhead.h Sep 11 '18 at 13:18
  • use with type sudo – abu-ahmed al-khatiri Sep 11 '18 at 13:21
  • f i give sudo command the response is like > ubuntu@ubuntu72:~$ sudo su sudo: unable to resolve host ubuntu72 [sudo] password for ubuntu: – crackhead.h Sep 11 '18 at 13:22
  • you still have hosts issue, follow my answered updated – abu-ahmed al-khatiri Sep 11 '18 at 13:24
  • All you mentioned in your answer i already tried, it wont work. Is there any alternative way? – crackhead.h Sep 11 '18 at 13:30
0

Try to use a Ubuntu DVD or Stick (same or newer release) to start an independet system. Then it should be possible to edit the files like /etc/hosts. Unfortunately this does not resolve the cause of this strange issue. Do not miss to e2fsck the partitions when started from CD/DVD/stick. The system or the GUI may store the host name in etc in files named(!) hosts, hosts.conf, host or hostname. When started from CD try to find them all ("sudo ls -latr host*" should do it, otherwise use find.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.