4259 links
  • Arnaud's links
  • Home
  • RSS Feed
  • Tag cloud
  • Login
search: tag:audit tag:ssh — newest first
  • linux - Is it possible to get OpenSSH to log the public key that was used in authentication? - Server Fault

    Je préfère cette solution, à savoir passer sshd en VERBOSE.

    L'autre solution consiste à utiliser environment dans le fichier authorized_keys puis à écrire dans un fichier (à l'aide de .bashrc par exemple). Mais l'utilisateur peut modifier ce fichier..

    ssh-keygen -lf /path/to/public_key_file

    December 23, 2014 - permalink - http://serverfault.com/questions/291763/is-it-possible-to-get-openssh-to-log-the-public-key-that-was-used-in-authenticat
    audit ssh
  • How to log history and logins from multiple ssh-keys under one user account | Screenage

    Une astuce utile pour faire un audit des connexions par clé sur un compte (quand on a plusieurs personnes avec des clés différentes qui accèdent au meme user)

    Implémentation rapide :

    !/bin/bash

    On convertit le authorized_keys pour ajouter la variable d'env

    cp ~/.ssh/authorized_keyz ~/.ssh/authorized_keyz.ORIGINAL

    IFS=$'\n'
    for line in $(cat .ssh/authorized_keys)
    do
    comment=$(echo $line|cut -d' ' -f3)
    echo "environment=\"SSH_USER=$comment\" $line" >> ~/.ssh/authorized_keyz.COMMENT
    done

    cp ~/.ssh/authorized_keyz.COMMENT ~/.ssh/authorized_keyz

    Puis dans le bashrc de l'user, ajouter ça :

    if [ "$SSH_USER" != "" ]; then
    now=$(date +%Y-%m-%d_%H-%M-%S)
    echo $now : User $SSH_USER logged in >> ~/ssh-audit.log
    fi

    May 14, 2014 - permalink - http://www.screenage.de/blog/2012/02/10/how-to-log-history-and-logins-from-multiple-ssh-keys-under-one-user-account-with-puppet/
    audit ssh