# sshd take long time to start



## mfaridi (Apr 25, 2009)

it is 4 days when I reboot system , when sshd want start , it take long time to start and after 3 minute it start and I can login to my system and use it 
I do not know what happen.

I do not have this problem before 

I use 


```
FreeBSD Mostafa.Faridi 7.0-RELEASE-p12 FreeBSD 7.0-RELEASE-p12 #9: Thu Apr 23 11:09:08 IRDT 2009     Mostafa@Mostafa.Faridi:/usr/obj/usr/src/sys/GMFARIDISRV  i386
```

what I must do ?


----------



## MG (Apr 26, 2009)

Are you able to ping the adresses in /etc/hosts and your DNS-servers in /etc/resolv.conf?
You can also try starting sshd  manually to see what happens:


```
killall -KILL sshd
/etc/rc.d/sshd restart
```


----------



## mfaridi (Apr 26, 2009)

after 3 minute sshd start and everything is OK and I can connect to internet and use it


----------



## MG (Apr 26, 2009)

Maybe regenerate your private key files.

```
/etc/rc.d/sshd keygen
```
Then rename or remove the files mentioned by that command and execute it again.


----------



## fronclynne (Apr 26, 2009)

It is almost certainly a DNS issue.

If you only ever connect to machines by ip address or names in /etc/hosts, you can set
	
	



```
UseDNS no
```
in /etc/ssh/sshd_config
.


----------

