Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[SOLVED] Initial run of sudo is slow

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
dcihon
Posts: 279
Joined: 2012-09-23 16:18
Been thanked: 3 times

[SOLVED] Initial run of sudo is slow

#1 Post by dcihon »

I am on Debian Testing, not sure if that makes a difference here though.
I am still researching this problem but haven't found a solution yet.
Tried messing with /etc/hosts /etc/sudoers /etc/resolv.conf /etc/hostname
All of these things seem fine.
What happens is when I first open a terminal and type sudo apt-get update there is a delay after entering my password and the command runs.
The next time I run sudo apt-get update it runs immediately and doesn't ask for my password as expected.
Any ideas would be helpful.
Thanks
Dan
Last edited by dcihon on 2018-02-24 16:57, edited 1 time in total.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Initial run of sudo is slow

#2 Post by Head_on_a_Stick »

dcihon wrote:when I first open a terminal and type sudo apt-get update there is a delay after entering my password and the command runs
Try using this in another terminal before you run the `sudo` command:

Code: Select all

sudo journalctl -fx
This will show a "live" log of the systemd journal and any errors with `sudo` should show up in that terminal.
deadbang

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Initial run of sudo is slow

#3 Post by debiman »

are you using encryption?
i experience something very similar ssh'ing into my server, ever since i encrypted the partition.

dcihon
Posts: 279
Joined: 2012-09-23 16:18
Been thanked: 3 times

Re: Initial run of sudo is slow

#4 Post by dcihon »

No encryption on my system.

This is what I see:

Code: Select all

Feb 24 11:36:18 cihonm nslcd[1518]: [7b8ddc] <authz="cihonm"> failed to bind to LDAP server ldap://198.105.254.24/: Can't contact LDAP server: Connection timed out
Feb 24 11:36:18 cihonm nslcd[1518]: [7b8ddc] <authz="cihonm"> no available LDAP server found: Can't contact LDAP server: Connection timed out
Feb 24 11:36:18 cihonm sudo[12600]: pam_ldap(sudo:account): error reading from nslcd: Connection reset by peer
Feb 24 11:36:18 cihonm sudo[12600]:   cihonm : TTY=pts/1 ; PWD=/home/cihonm ; USER=root ; COMMAND=/usr/bin/apt-get update
Feb 24 11:36:18 cihonm sudo[12600]: pam_unix(sudo:session): session opened for user root by (uid=0)
Feb 24 11:36:20 cihonm sudo[12600]: pam_unix(sudo:session): session closed for user root
Why it is trying to do something with LDAP I have no Idea. I obviously turned some kind of LDAP setting on by mistake.
I will research this.
Thanks for that pointer.
Last edited by dcihon on 2018-02-24 16:57, edited 1 time in total.

dcihon
Posts: 279
Joined: 2012-09-23 16:18
Been thanked: 3 times

Re: Initial run of sudo is slow

#5 Post by dcihon »

Solved
For some reason that I don't remember I installed nslcd.
I must have been playing with something to do with LDAP.
Uninstalled it.
All working fine now.

Post Reply