Outils pour utilisateurs

Outils du site


blog

Pb sudo - Lenteur sudo

Voir

  • La machine doit pouvoir pinguer son hostname
    • ping $(hostname -s)
    • ping $(hostname -f)
    • UseDNS no dans /etc/ssh/sshd_config
    • GSSAPIAuthentication no dans /etc/ssh/sshd_config
  • Connexion LDAP / Service sssd - Si sssd stop est-ce OK ?
    • systemctl stop sssd
    • ps -ef | grep sssd
  • Les commandes suivantes fonctionnent-elles ? Si non voir Err timeout org.freedesktop.login1
    • hostnamectl
    • timedatectl

Lenteur sudo - Err timeout org.freedesktop.login1

Failed to activate service 'org.freedesktop.login1': timed out

# strace -f sudo su -c ls
recvmsg(4, {msg_namelen=0}, MSG_DONTWAIT|MSG_NOSIGNAL|MSG_CMSG_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
ppoll([{fd=4, events=POLLIN}], 1, {tv_sec=24, tv_nsec=999821000}, NULL, 8) = 1 ([{fd=4, revents=POLLIN}], left {tv_sec=24, tv_nsec=999682934})
recvmsg(4, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="l\2\1\1\n\0\0\0\1\0\0\0=\0\0\0\6\1s\0\5\0\0\0", iov_len=24}], msg_iovlen=1, msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_DONTWAIT|MSG_NOSIGNAL|MSG_CMSG_CLOEXEC) = 24
recvmsg(4, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base=":1.10\0\0\0\5\1u\0\1\0\0\0\10\1g\0\1s\0\0\7\1s\0\24\0\0\0"..., iov_len=66}], msg_iovlen=1, msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_DONTWAIT|MSG_NOSIGNAL|MSG_CMSG_CLOEXEC) = 66
sendmsg(4, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="l\1\0\1p\0\0\0\2\0\0\0\230\0\0\0\1\1o\0\27\0\0\0/org/fre"..., iov_len=168}, {iov_base="\0\0\0\0\2373\0\0\4\0\0\0sudo\0\0\0\0\3\0\0\0tty\0\4\0\0\0"..., iov_len=112}], msg_iovlen=2, msg_controllen=0, msg_flags=0}, MSG_DONTWAIT|MSG_NOSIGNAL) = 280
recvmsg(4, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="l\4\1\1\n\0\0\0\2\0\0\0\215\0\0\0\1\1o\0\25\0\0\0", iov_len=24}], msg_iovlen=1, msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_DONTWAIT|MSG_NOSIGNAL|MSG_CMSG_CLOEXEC) = 24
recvmsg(4, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="/org/freedesktop/DBus\0\0\0\2\1s\0\24\0\0\0"..., iov_len=146}], msg_iovlen=1, msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_DONTWAIT|MSG_NOSIGNAL|MSG_CMSG_CLOEXEC) = 146
recvmsg(4, {msg_namelen=0}, MSG_DONTWAIT|MSG_NOSIGNAL|MSG_CMSG_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
ppoll([{fd=4, events=POLLIN}], 1, {tv_sec=24, tv_nsec=999873000}, NULL, 8

^Cstrace: Process 13215 detached
 <detached ...>
# journalctl -f
Jan 16 10:56:42 SRV_01 dbus[7464]: [system] Failed to activate service 'org.freedesktop.login1': timed out
Jan 16 10:56:42 SRV_01 sudo[10716]: pam_systemd(sudo:session): Failed to create session: Failed to activate service 'org.freedesktop.login1': timed out
Jan 16 10:56:42 SRV_01 sudo[10716]: pam_unix(sudo:session): session opened for user root by admin(uid=0)
Jan 16 10:56:42 SRV_01 su[12341]: (to root) admin on none
Jan 16 10:56:42 SRV_01 dbus[7464]: [system] Activating via systemd: service name='org.freedesktop.login1' unit='dbus-org.freedesktop.login1.service'
Jan 16 10:57:07 SRV_01 dbus[7464]: [system] Failed to activate service 'org.freedesktop.login1': timed out
Jan 16 10:57:07 SRV_01 su[12341]: pam_systemd(su:session): Failed to create session: Failed to activate service 'org.freedesktop.login1': timed out
Jan 16 10:57:07 SRV_01 su[12341]: pam_unix(su:session): session opened for user root by admin(uid=0)
Jan 16 10:57:07 SRV_01 su[12341]: pam_unix(su:session): session closed for user root
Jan 16 10:57:07 SRV_01 sudo[10716]: pam_unix(sudo:session): session closed for user root
Solution
# systemctl daemon-reexec
systemctl restart systemd-logind

Cleanup abandoned sessions from systemd

A tester

Source https://github.com/systemd/systemd/issues/1961

Delete session files

find /run/systemd/system -name "session-*.scope" -delete

Delete session directories

rm -rf /run/systemd/system/session*scope*

Remove the abandoned sessions

systemctl | grep "abandoned" | grep -e "-[[:digit:]]" | sed "s/\.scope.*/.scope/" | xargs systemctl stop

Autre

systemctl list-units --state=abandoned -t scope --no-legend 
2025/03/24 15:06

Pb ssh

pseudo-terminal will not be allocated because stdin is not a terminal

https://github.com/cea-hpc/clustershell/issues/227

Pseudo-terminal will not be allocated because stdin is not a terminal.

$ ssh serveur -- sudo ls /root
sudo: sorry, you must have a tty to run sudo
$ ssh -t serveur  -- sudo ls /root
config.snmp.tar.gz  install.log  install.log.syslog  main.cf  sources  tar_files
Connection to server.acme.fr closed.

Voir aussi ssh -tt

2025/03/24 15:06

Pb SSH over VPN - Connexion KO après expecting SSH2_MSG_KEX_ECDH_REPLY

Connexion SSH KO après debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
Alors que flux réseaux OK.

ip r get 192.168.255.118
192.168.255.118 dev tun0 src 192.168.100.4 uid 0 
    cache 

Solution : Réduire la MTU

ip l set mtu 1200 dev tun0
2025/03/24 15:06

Pb SSH long lent

Voir aussi :

Sources :

Pb

ssh -vvv plop
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.

[ TRES LENT ICI ]

Autre commande longue. su sur le serveur et connecté en root

su - user -c date

Solution

# systemctl daemon-reexec
systemctl restart dbus
systemctl restart systemd-logind

Autres solutions pour autres Pb

DNS, Kerberos/GSSAPI

Coté client ~/.ssh/config

Host *
    GSSAPIAuthentication no
    GSSAPIKeyExchange no

Coté serveur /etc/ssh/sshd_config

UseDNS no
2025/03/24 15:06

Cloud OpenStack DevStack

OpenStack

Voir aussi :

  • OpenNebula
  • CloudStack

Autre

  • Certified OpenStack Administrator Exam

Pré requis :

  • 8Go RAM
  • 2 Cores
  • 1 NIC
  • Ubuntu LTS

Voir :

/etc/environment

# http_proxy=http://192.168.56.1:3128
# https_proxy=http://192.168.56.1:3128
ALL_PROXY=http://192.168.56.1:3128
NO_PROXY=localhost,127.0.0.0/8,localaddress,.localdomain.com,192.168.56.0/24,::1
apt-get update
apt-get upgrade
export ALL_PROXY=http://127.0.0.1:3128
export NO_PROXY=localhost,127.0.0.1,192.168.56.11
 
git config --global http.proxy http://127.0.0.1:3128
git clone https://git.openstack.org/openstack-dev/devstack

Notes en vrac

sudo apt-get install \
git \
python-cliff \
python-dev \
python-pip \
ebtables \
bridge-utils \
thin-provisioning-tools \
qemu
 
sudo pip install --upgrade pip
#sudo pip install -U os-testr
 
git config --global http.proxy http://127.0.0.1:3128
git clone https://git.openstack.org/openstack-dev/devstack master
cd master
cp samples/local.conf .

local.conf

ADMIN_PASSWORD=secret
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
 
# hostname -I
HOST_IP=192.168.56.11
 
#IPV4_ADDRS_SAFE_TO_USE=192.168.56.0/24
#FLOATING_RANGE=192.168.56.0/24
 
VERBOSE=True
 
#RECLONE=yes
#PIP_UPGRADE=True
 
#IP_VERSION=4+6
IP_VERSION=4
DEFAULT_INSTANCE_TYPE=m1.tiny

stackrc

HOST_IP=${HOST_IP:-172.16.1.5}
GIT_BASE=${GIT_BASE:-https://git.openstack.org}
sudo master/tools/create-stack-user.sh
sudo chown -R stack:stack master
sudo ufw disable
 
sudo su stack
master/stack.sh

/etc/nova/nova.conf

compute_driver = libvirt.LibvirtDriver
 
[libvirt]
virt_type = kvm
 
cpu_mode = custom
cpu_model = Nehalem

Désinstall & réinstall

./unstack.sh
./clean.sh
./stack.sh
sudo reboot
/usr/bin/nova-compute --debug --config-file /etc/nova/nova.conf --log-file /var/log/nova/nova-compute.log
tail -n 3 /var/log/nova/nova-compute.log
systemctl restart openstack-nova-compute.service

https://docs.openstack.org/nova/latest/user/support-matrix.html

journalctl --unit 'devstack@*'
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