# su takes several seconds ?!

## xiaweitang

This is very strange. When i want to change to root user from normal user by "su", it sometimes takes several seconds before showing the new prompt! I have never seen this in using Linux.

----------

## InExile

Do you have any external authentication configured like winbind or nis or ldap?

----------

## xiaweitang

I don't think so. I don't even understand what are winbind or nis or ldap.

----------

## patrikas

I have seen situations like this with huge shell startup (.bashrc, .cshrc, profile) scripts. My laptop takes more than a second with many bash completions enabled.

----------

## krinn

Certainly depend on that bug, and will be also be fix https://forums.gentoo.org/viewtopic-t-817522-highlight-.html

Sure it's the time taken to fail to resolve the dns

----------

## xiaweitang

I tried the suggested /etc/hosts file, but the prolem remains. Note that it's not happening always, but randomly.

----------

## NathanZachary

Do you also see a delay between hitting "enter" after typing your username and the password prompt appearing?

----------

## xiaweitang

 *NathanZachary wrote:*   

> Do you also see a delay between hitting "enter" after typing your username and the password prompt appearing?

 

No, there is no delay between typing su and the password prompt.

----------

## NathanZachary

Try stopping all network-related services temporarily, and then issuing the su command.  For instance:

```

/etc/init.d/net.eth0 stop

/etc/init.d/net.wlan0 stop

```

and so on for your interfaces.  Leaving only the loopback started, try using su to see if the delay is gone.

----------

## xiaweitang

 *NathanZachary wrote:*   

> Try stopping all network-related services temporarily, and then issuing the su command.  For instance:
> 
> ```
> 
> /etc/init.d/net.eth0 stop
> ...

 

No, the delay is not gone.

----------

## NathanZachary

Okay, then it is probably not anything to do with your network.  Try changing your password for your root user.  Just temporarily, make it something short and simple.

----------

## xiaweitang

I changed the password to only two letters, but the problem remains.

----------

## NathanZachary

I will see what else I can find about the problem, but those were the two potential reasons I knew (networking and password change).

----------

## xiaweitang

It seems the delay only happens in X, not in console.

----------

## xiaweitang

I'm almost sure the problem only happens when firefox is running.

----------

## Raptor85

Have you had flash running in firefox at times when this is happening?  I've seen flash eat up tons of resources bogging the entire system, causing delays like this, even when all the tabs no longer have it actively running.  Try running "top" while this is happening and look at memory usage/cpu usage.

----------

## Mike Hunt

Try running the command:

```
pwconv
```

Maybe it can help. See: man pwconv for details.

----------

## xiaweitang

 *Mike Hunt wrote:*   

> Try running the command:
> 
> ```
> pwconv
> ```
> ...

 

No, this doesn't help.

----------

## Mike Hunt

Try this:logout your X session to a console

run:

```
:> ~/.Xauthority
```

login your X session

and post the output of this please:

```
id <username>
```

----------

## Deathwing00

Moved from Installing Gentoo to Networking & Security.

----------

