Question

I have changed my hostname in linux mint and after that my sudo works slow I mean how to change the etc/sudoers back again to work properly or there is anything else that I have to change

Was it helpful?

Solution

you probably need to edit /etc/hosts to reflect your new hostname

otherwise it tries to find info about it via DNS (and timeouts, most probably)

look for:

127.0.0.1  localhost  oldname

and change to:

127.0.0.1  localhost  newname

Of course change only the line corresponding to oldname. Above I gave an an example of a machine which isn't connected to the net...

Below I give an example of a machine which have an IP:

127.0.0.1  localhost
a.b.c.d    oldname     <-- just edit that line

OTHER TIPS

Problem solved. I describe to help others.

I've had the same problem. All configurations were correct, but login via ssh and sudo were extremely slow.

cat /etc/hostname was correct, but something did not work.

I solved by changing the hostname NOT from the file but by the command

hostname name-of-the-host

In this way the problem has disappeared. Probably using the hostname command are done other operations and the modification is more complete than just modifying the /etc/hostname file manually.

Slowliness can be caused by not being able to resolve hostnames. This might be because of wrong entries in /etc/hosts or because of wrong settings in /etc/resolv.conf

Verify both so they be correctly configured. After that continue to the sudoers file.

Have you used the old hostname in the sudoers file, then update the sudoers content to reflect the changes.

find out what your current hostname is:

hostname -f

Edit the /etc/hosts file:

sudo vim /etc/hosts

change

127.0.0.1 oldhostname

to

127.0.0.1 current_hostname
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top