Outils pour utilisateurs

Outils du site


blog

Notes souris pave numérique

Voir :

cat /proc/bus/input/devices

/etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="psmouse.proto=bare"
update-grub
modprobe -r psmouse
modprobe psmouse

Voir /sys/module/psmouse/parameters/

Pb

Pb souris : http://ubuntuforums.org/showthread.php?t=2253552

sudo rmmod psmouse
sleep 3
sudo modprobe psmouse 

Diag

La souris est-elle vraiment détectée ?

xinput --list

Voir

lsusb
dmesg
2025/03/24 15:06

Notes Sonar SonarQube LDAP

Voir :

Voir aussi :

  • Checkmarx - KICS
  • MegaLinter

sonar/sonarqube-6.7.1/conf/sonar.properties

sonar.jdbc.username=sonar
sonar.jdbc.password=P@ssw0rd
sonar.jdbc.url=jdbc:postgresql://localhost/sonar
 
# General Configuration
sonar.security.realm=LDAP
ldap.url=ldap://acme.local:389
ldap.bindDn=admin
ldap.bindPassword=P@ssw0rd
 
# User Configuration
ldap.user.baseDn=DC=acme,DC=local
ldap.user.request=(&(objectClass=user)(sAMAccountName={login}))
ldap.user.realNameAttribute=cn
ldap.user.emailAttribute=mail
 
# Group Configuration
#ldap.group.baseDn=ou=Groups,dc=sonarsource,dc=com
#ldap.group.request=(&(objectClass=posixGroup)(memberUid={uid}))

Err

org.sonar.plugins.ldap.LdapException: Unable to retrieve details for user in <default>

NC

LdapUserMapping{baseDn=cn=users,dc=acme,dc=local, request=(&(objectClass=user)(sAMAccountName={0})), realNameAttribute=cn, emailAttribute=mail}
ldapsearch -D admin -W -h acme.local -b "DC=acme,DC=local" "(&(objectClass=user)(sAMAccountName=user))"

Service SystemD

Voir exemple_4_-systemd_appelant_un_script_sysv_init systemd_service//-_exemples

2025/03/24 15:06

Notes socket Unix

Voir :

netstat -ln | grep mysql
 
ss -x
netstat --unix
 
 
cat /proc/net/unix

Connect to an existing stream socket

nc -U /path/to/socket

Create a listening stream socket

nc -lU /path/to/socket
# lsof -U -a -p $(pidof mysqld)
COMMAND  PID  USER   FD   TYPE             DEVICE SIZE/OFF  NODE NAME
mysqld  1766 mysql   18u  unix 0xffffa0c0b6f97800      0t0 26264 /var/run/mysqld/mysqld.sock type=STREAM
sudo curl -v --unix-socket /var/run/crio/crio.sock http://localhost/info | jq

Podman

$ sudo curl -H "Content-Type: application/json" --unix-socket /var/run/docker.sock http://localhost/_ping
OK

Unit socket SystemD

2025/03/24 15:06

Notes socat

Dance, Socat Dance !

Voir aussi :

Voir également spiped :

Voir :

Exemple

socat TCP4-LISTEN:10053,reuseaddr,fork,su=nobody TCP4:10.9.0.6:10050

Mais la bonne solution est :

iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 10053 -j DNAT --to-destination 10.9.0.6:10050
iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE

TUN

TUN Server
socat -d -d TCP-LISTEN:11443,reuseaddr TUN:192.168.255.1/24,up

After starting this command, socat will wait for a connection and then create a TUN pseudo network device with address 192.168.255.1; the bit number specifies the mask of the network that is pretended to be connected on this interface.

TUN Client
socat TCP:1.2.3.4:11443 TUN:192.168.255.2/24,up

This command should establish a connection to the server and create the TUN device on the client.

OpenVPN

http://serverfault.com/questions/580442/tunnel-over-http-server

OpenVPN sur le port 443

socat TCP-LISTEN:9999,bind=localhost OPENSSL:proxy.example.com:443
Socket Unix

https://www.ffdn.org/wiki/doku.php?id=documentation:openvpn:fdn

socat /var/run/openvpn.management.serveur EXEC:"echo kill foo@vpn.fdn.fr"
echo "status 3" | socat stdio /var/run/openvpn.mgmt
Tunnel SSH Over SCTP

http://0x27.me/2015/07/27/SSH-Over-SCTP.html

assuming you want the SCTP socket to listen on port 80/SCTP and sshd is on 22/TCP

socat SCTP-LISTEN:80,fork TCP:localhost:22 

replace SERVER_IP with IP of listening server, and 80 with whatever port the SCTP listener is on :)

socat TCP-LISTEN:1337,fork SCTP:SERVER_IP:80

replace username and -p port value as needed…

ssh -lusername localhost -D 8080 -p 1337 # 
Décapsuler HTTPS
socat TCP-LISTEN:8082,reuseaddr,pf=ip4,fork OPENSSL:192.168.51.142:443,verify=0

Autres

echo "GET hosts" | socat - TCP4:127.0.0.1:6557,crnl
socat -ls TCP4-LISTEN:443,fork,reuseaddr TCP4:10.96.0.1:443
2025/03/24 15:06

Notes SNMPv3

Conf serveur

Méthode 1

/var/lib/net-snmp/snmpd.conf

# rouser nagios
createUser nagios SHA NagiosP@ssw0rd AES !P@ssw0rdNagios!
systemctl restart snmpd

Après redémarrage le mot de passe est chiffré dans /var/lib/net-snmp/snmpd.conf pour CentOS/RedHat ou dans /var/lib/snmp/snmpd.conf pour Debian.

Exemple :

usmUser 1 3 0x80001f87801c283d152f784a8700000000 "nagios" "nagios" NULL .1.3.6.1.6.3.10.1.1.2 0xbb07cb9c6ab1f0237b6981639b368642 .1.3.6.1.6.3.10.1.2.2 0xbb17cc9c6ab1f1347b6981639b368653 0x
Méthode 2

Install du paquet qui contient net-snmp-config

apt install libsnmp-dev

Création du premier utilisateur

systemctl stop snmpd
# echo -e "newuser\nmy_password\n\n" | (net-snmp-config --create-snmpv3-user)
net-snmp-config --create-snmpv3-user -a 'my_password' newuser
systemctl start snmpd

Test de connexion avec l'utilisateur nouvellement crée

snmpwalk -r 2 -v 3 -a MD5 -A 'my_password' -l authNoPriv -u newuser localhost .1

Création d'un nouvelle utilisateur “nagios”

snmpusm -v 3 -u newuser -a MD5 -A 'my_password' -l authNoPriv localhost create nagios newuser

Modifier le fichier /etc/snmp/snmpd.conf et ajouter : /etc/snmp/snmpd.conf

rouser nagios auth

Redémarrer snmpd

systemctl restart snmpd

Changement du mot de passe. Par défaut l'utilisateur crée hérite du mot de passe du créateur.

snmpusm -v 3 -u nagios -a MD5 -A 'my_password' -x DES -l authNoPriv localhost passwd 'my_password' 'P@ssw0rd'

A présent il convient de remetre l'utilsateur nagios en lecture seule

/etc/snmp/snmpd.conf

rouser nagios auth
systemctl restart snmpd

Test de connexion avec l'utilisateur Nagios et le nouveau mot de passe

snmpwalk -r 2 -v 3 -a MD5 -A "P@ssw0rd" -l authNoPriv -u nagios localhost .1
UsmUser

Conf client

apt-get install snmp
man snmp.conf
mkdir ~/.snmp/
mkdir ~/.snmp/hosts/

/.snmp/snmp.conf ou /.snmp/hosts/localhost.conf

defSecurityName nagios
#defSecurityLevel authPriv
defSecurityLevel authNoPriv
defAuthType MD5
#defPrivType DES
defAuthPassphrase P@ssw0rd
#defPrivPassphrase P@ssw0rd
chmod 600 ~/.snmp/snmp.conf
chmod 600 ~/.snmp/hosts/*.conf

Test

snmpwalk -r 2 -v 3 localhost .1

Pb

Err - no encryption type specified
no encryption type specified, which I need in order to know to change the key

Cela peut se produire si oublie de l'ajout rouser nagios dans /etc/snmp/snmp.conf

2025/03/24 15:06
blog.txt · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki