Merci, la commande sudo -i fonctionne pour ce type de manipulation.
Mais ça continue à déconner : quand je lance
wg genkey > /etc/wireguard/privkey
J'ai :
Warning: writing to world accessible file.
Consider setting the umask to 077 and trying again.
Je ne connais pas la commande umask : faut-il essayer avec chmod ?