[SOLVED] Initial run of sudo is slow

Kernels & Hardware, configuring network, installing services

[SOLVED] Initial run of sudo is slow

Postby dcihon » 2018-02-24 15:29

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.
dcihon
 
Posts: 233
Joined: 2012-09-23 16:18

Re: Initial run of sudo is slow

Postby Head_on_a_Stick » 2018-02-24 16:16

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.
User avatar
Head_on_a_Stick
 
Posts: 7908
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Initial run of sudo is slow

Postby debiman » 2018-02-24 16:43

are you using encryption?
i experience something very similar ssh'ing into my server, ever since i encrypted the partition.
User avatar
debiman
 
Posts: 2818
Joined: 2013-03-12 07:18

Re: Initial run of sudo is slow

Postby dcihon » 2018-02-24 16:50

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: 233
Joined: 2012-09-23 16:18

Re: Initial run of sudo is slow

Postby dcihon » 2018-02-24 16:56

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.
dcihon
 
Posts: 233
Joined: 2012-09-23 16:18


Return to System configuration

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable