# PAM slow initializing. Affected SAMBA, ssh are also slow!

## ova

Hi.

There is a strange issue I've found. During ssh login PAM initializtion take a very long (5-10 seconds) time on a absolutly free server!!! During system startup after starting last service everything stops on ~10 seconds and only after this I can see login invitation. This has affects SAMBA which use PAM to auth users, so the networking is slow  :Sad: 

A little experiment to understand that it is really PAM. I've started sshd -d to see what is going on. Why my authentification is so slow so

```

file-server root # sshd -d 

debug1: sshd version OpenSSH_3.7.1p2

debug1: read PEM private key done: type RSA

debug1: private host key: #0 type 1 RSA

debug1: read PEM private key done: type DSA

debug1: private host key: #1 type 2 DSA

socket: Address family not supported by protocol

debug1: Bind to port 22 on 0.0.0.0.

Server listening on 0.0.0.0 port 22.

debug1: Server will not fork when running in debugging mode.

```

At this point server is waiting for connections... then I'm trying to connect :

```

Connection from 172.16.0.1 port 32781

debug1: Client protocol version 2.0; client software version OpenSSH_3.7.1p2

debug1: match: OpenSSH_3.7.1p2 pat OpenSSH*

debug1: Enabling compatibility mode for protocol 2.0

debug1: Local version string SSH-2.0-OpenSSH_3.7.1p2

debug1: permanently_set_uid: 22/22

debug1: list_hostkey_types: ssh-rsa,ssh-dss

debug1: SSH2_MSG_KEXINIT sent

debug1: SSH2_MSG_KEXINIT received

debug1: kex: client->server aes128-cbc hmac-md5 none

debug1: kex: server->client aes128-cbc hmac-md5 none

debug1: SSH2_MSG_KEX_DH_GEX_REQUEST received

debug1: SSH2_MSG_KEX_DH_GEX_GROUP sent

debug1: expecting SSH2_MSG_KEX_DH_GEX_INIT

debug1: SSH2_MSG_KEX_DH_GEX_REPLY sent

debug1: SSH2_MSG_NEWKEYS sent

debug1: expecting SSH2_MSG_NEWKEYS

debug1: SSH2_MSG_NEWKEYS received

debug1: KEX done

debug1: userauth-request for user root service ssh-connection method none

debug1: attempt 0 failures 0

debug1: PAM: initializing for "root"

```

At this point process stops on ~10 seconds and with then with the next strings of text the password promt was show to me...

Please help me what is the problem. How to speedup PAM?

The useser in the local network are very frustrating with SAMBA that is also affected...

Searching forum gives me nothing...

----------

## ova

Hey.

Searching bug's on gentoo.org gives no result. But I need to solve this problem. I don't want to chage distribution, as I really like gentoo, but in a week I will be forced to... :Sad: 

----------

