Your browser does not allow storing cookies. We recommend enabling them.

SSH

Example with Certificate Authentication

This example presents a typical use case for user mapping: matching a certificate and a user. Selectors are usually used for this purpose, but if you have a database that contains information about users and certificates, you can use an external application defined in the mapper element to query the database. Based on the query result, users can be allowed/denied access to the server.

In this example the user is allowed to log in only if the regular expression provided in the certificate element matches, that is if CN in the certificate's subject name consists of three words separated by periods (.) and a set of digits in the end (for example "Smith.John.James.1234").

<authentication-methods login-grace-time="600">
  <authentication action="allow">
    <auth-publickey />
    <authentication name="authentication3" action="allow">
      <selector>
        <certificate field="subject-name" 
         regexp="C=FI, O=SSH, CN=\\w\+\\.\\w\+\\.\\w\+?\\.?\\w\+?\\.\\d\+" />
      </selector>
      <mapper command="/path/to/python /path/to/script1.py"/>
    </authentication>
  </authentication>
</authentication-methods>


 

 
Highlights from the SSH.COM blog:

  • Cryptomining with the SSH protocol: what big enterprises need to know about it

    Cryptomining malware is primarily thought of as targeting desktops and laptops and is used to hijack system resources to mine cryptocurrency.
    Read more
  • SLAM the door shut on traditional privileged access management

    Did you know that something as trivial-sounding as granting access for your developers or third parties to a product development environment can throw a gorilla-sized monkey wrench into your operations and productivity?
    Read more
  • We broke the IT security perimeter

    Everyone understands the concept of a security perimeter. You only gain access if you are identified and authorized to do so.
    Read more