Outils pour utilisateurs

Outils du site


blog

Notes SSH proxy jump ProxyCommand

L’intérêt étant de ne pas déposer ailleurs sa clef SSH privée

ssh -t -A serveurBastionRebond ssh serveurPlop118

Ou plus simple :

~/.ssh/config

Host serveurPlop118
        ProxyCommand ssh -W %h:%p bastion
        
### Si besion

Host bastion
        Hostname 192.168.2.34

Avec sshpass

~/.ssh/config

Host l12* 192.168.* !pom01 !l12srvpom01 !192.168.50.160
        User admin
        ProxyCommand sshpass -e ssh -W %h:%p pom01

Host l12srvpom01 pom01
        Hostname 192.168.50.160
        User admin
read -s SSHPASS
export SSHPASS

Pb

$ ssh -t -A bastion ssh -o StrictHostKeychecking=no 192.168.1.22
Permission denied (publickey).
Shared connection to 171.33.90.69 closed

Solution

ssh -O stop bastion

ou

ssh -o ControlMaster=no 192.168.1.22

Exemple

~/.ssh/config

Host rebond
        Hostname 192.168.89.155
        User jean

Host old-rhel5
        Hostname 192.168.50.20
        User root
        ProxyCommand ssh -W %h:%p rebond
        KexAlgorithms +diffie-hellman-group1-sha1,diffie-hellman-group14-sha1
        HostKeyAlgorithms +ssh-rsa
        PubkeyAcceptedKeyTypes +ssh-rsa
        SetEnv TERM=linux
        
Host old-rhel3
        Hostname 192.168.50.30
        KexAlgorithms +diffie-hellman-group1-sha1,diffie-hellman-group14-sha1
        HostKeyAlgorithms +ssh-rsa
        PubkeyAcceptedKeyTypes +ssh-rsa
        Ciphers +aes256-cbc
        SetEnv TERM=linux

Host centreon
        Hostname 192.168.50.21
        User root
        ProxyCommand ssh -W %h:%p rebond
        RemoteForward 3128 192.168.89.221:3128
        LocalForward 8081 localhost:80
        # ExitOnForwardFailure yes
        # SendEnv LANG LC_*

FIXME

2025/07/23 14:43 · Jean-Baptiste

Notes git et session generique - author commiter envvars

export GIT_AUTHOR_NAME="Richard STALLMAN"
export GIT_AUTHOR_EMAIL="nospamme@gnu.org"
export GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"
export GIT_COMMITTER_EMAIL="$GIT_AUTHOR_NAME"

FIXME

2025/07/22 12:16 · Jean-Baptiste

GNU Linux - vérifier un mot de passe système /etc/shadows

Si pas de caractère “$” au début, c'est que ce n'est pas au format yescrypt. Si hash fait 13 caractère c'est que c'est probablement encodé en DES. Dans ce cas le Salt fait 2 caractère

$ mkpasswd -S ab -m DES 'P@ssw0rd'
abnkC.5tqv/G6

Voir man 5 crypt

OpenSSL

openssl passwd -6 -salt xyz  yourpass

Ansible

Jinja

password_hash(hashtype='md5', salt='salt')
password_hash(hashtype='sha512', salt='salt', rounds='10')

hashtype: Uses sha512 by default ($6$) if no algorithm is specified.

Python

Voir :

# DeprecationWarning: 'crypt' is deprecated and slated for removal in Python 3.13
# import crypt
 
import crypt-r
 
# usage: crypt.crypt("password", "hasing algorithm + salt")
print(crypt.crypt("test1234", "$6$OXE8gHwh2.nmuwp7$"))

FIXME

2025/06/05 14:40 · Jean-Baptiste

Notes Terminal sympa

Voir tmux

Terminology

Autres http://linuxfr.org/nodes/104878/comments/1590063

  • Terminal: rxvt-unicode
  • Transparence: compton
  • Shell: zsh
  • zsh config: oh-my-zsh
  • oh-my-zsh theme: agnoster
  • Font: inconsolata with powerline (powerline required for git related icons)
2025/06/05 11:05 · Jean-Baptiste
blog.txt · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki