# sshd is ignoring /etc/ssh/sshd_config

## cs.cracker

I dont know why. I want to disable root logons for sercurity and add a banner message, but editing /etc/ssh/sshd_config does not work. I dont know why, but it is completely ignoring it. I dont know what files I should post, so any help at all is appreciated.

----------

## pointers

I cannot guess why but you can pass extra arguments to sshd like;

 *Quote:*   

> 
> 
> -f configuration_file
> 
>              Specifies the name of the configuration file.  The default is /etc/ssh/sshd_config.  sshd refuses to start if
> ...

 

default is /etc/ssh/sshd_config.  To debug your problem you can start sshd with -f flag.

----------

## justanothergentoofanatic

Changes in sshd_config won't take effect until you restart sshd.

-Mike

----------

## cs.cracker

I have restarted sshd. How would I pass this flag through init.d?

----------

## justanothergentoofanatic

Hrm...what happens if you add some gibberish to /etc/ssh/sshd_config (anything, like the line "hello world") and then do /etc/init.d/sshd restart?

-Mike

----------

## cs.cracker

sshd restarts fine and runs exactly like it did before I modified the file.

----------

## justanothergentoofanatic

Very strange...what happens if you do /usr/bin/sshd -f /etc/ssh/sshd_config?

What use flags and cflags did you compile sshd with?

md5sum /etc/init.d/sshd gives me:

0a1428803057b7d25e624c6b297980d8  /etc/init.d/sshd

Is yours the same?

-Mike

----------

## moocha

Did you compile your sshd outside of the portage system by any chance?

If yes - you're on your own until you stick to portage's version.

If no - what's your current openssh version?

What happens if you run sshd in debug mode, like this:

```
/usr/sbin/sshd -ddd
```

? The first three or so lines should indicate the localtion of its used configuration.

----------

