Outils pour utilisateurs

Outils du site


blog

SSH SFTP chroot

Voir aussi :

useradd partage
# useradd is a low level utility for adding users. On Debian, administrators should usually use adduser(8) instead.
 
groupadd sftpusers
 
usermod -aG sftpusers partage
 
mkdir /sftp
 
mkdir /sftp/partage
 
chown partage:partage /sftp/partage
chmod 700 /sftp/partage

Test

sudo -u partage ls /sftp/partage

Si besoin

chmod o+x /sftp/

/etc/ssh/sshd_config

Subsystem   sftp    internal-sftp

Match Group sftpusers
ChrootDirectory /sftp/
ForceCommand internal-sftp -d /%u
systemctl restart sshd

FIXME

2025/09/04 14:28 · Jean-Baptiste

Notes Ansible SemaphoreUI

Voir :

Voir aussi :

  • Rundeck
  • Polemarch
  • Gitlab-CI
  • AWX

Voir aussi autour d'AWX / Ansible :

  • ARA Records Ansible
curl -X 'GET' -H 'Authorization: Bearer nb8jzkj3rcgoxej99onocburcsstghqhalnbsq5v6mg=' -H 'accept: text/plain; charset=utf-8' 'http://localhost:3000/api/project/1/templates' | jq .
2025/09/01 10:17 · Jean-Baptiste

Pb ssh - key type ssh-rsa not in PubkeyAcceptedKeyTypes

Sur AlmaLinux 8

# journalctl -u sshd -f
août 27 11:42:28 plop.acme.local sshd[35283]: userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedKeyTypes [preauth]

Solution

# update-crypto-policies --show
DEFAULT:NO-SHA1:NO-SSHCBC:NO-WEAKMAC

# update-crypto-policies --set legacy
Setting system policy to LEGACY
Note: System-wide crypto policies are applied on application start-up.

# update-crypto-policies --show
LEGACY

Voir /etc/crypto-policies/back-ends/opensshserver.config

Ou (ne marche pas sous AlmaLinux 8)

/etc/ssh/sshd_config

PubkeyAcceptedAlgorithms=+ssh-rsa
2025/08/27 15:55 · Jean-Baptiste

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
blog.txt · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki