# run 2 different sshd with different configs



## nekoexmachina (Jan 19, 2011)

Hello!
The thing I want to achieve is easy and secure access to my desktop from anywhere.
On my router I have rules to allow access from frequent-attended places with fixed external IPs to my default ssh with password-authorization.
But also I want to have second access point from anywhere with passphrased rsa-key.
How do I achieve that?

The variant I have now is keyed ssh-access to the router from which I go to the desk station: and I dont like it


----------



## phoenix (Jan 19, 2011)

You only need to run a single sshd, with a single config file.  Read the sshd_config(4) man page for the *Match* keyword.  You can configure Match blocks to do what you want.

Or, just enabled password-based and key-based logins (which is the default) and leave it at that.


----------



## DutchDaemon (Jan 19, 2011)

More precise: you can run as many sshd sessions with different configurations as you want, but not all on the same port  I'm running two sshd sessions, one for my access on port 22, and one for rsnapshot with its own settings/keys on port 65522. The latter runs as:


```
/usr/sbin/sshd -f /etc/ssh/sshd_config_rsnapshot
```

and is started separately from /etc/rc.local.


----------

