Bonjour à tous !
J'ai créé un script (.sh) qui permet d'activer mon serveur SSH.
Aucune des lignes ci-dessous fonctionne ! :mad:
Merci d'avance pour votre aide !
J'ai créé un script (.sh) qui permet d'activer mon serveur SSH.
Le mot de passe est demandé, j'ai donc ajouté la ligne suivante dans sudoers et tout fonctionne parfaitement.sudo -s /bin/launchctl load -w /System/Library/LaunchDaemons/ssh.plist
Sauf que ça pose quelques problèmes niveau sécurité alors j'ai tenté de modifier mon sudoers de manière à ce qu'une seule commande soit soumis au "NOPASSWD".MonCompte ALL=(ALL) NOPASSWD: ALL
Aucune des lignes ci-dessous fonctionne ! :mad:
Qu'est ce qui ne va pas ?ALL ALL= NOPASSWD: /bin/launchctl load -w /System/Library/LaunchDaemons/ssh.plist
MonCompte ALL=(ALL) NOPASSWD: /bin/launchctl load -w /System/Library/LaunchDaemons/ssh.plist
MonCompte ALL= NOPASSWD: /bin/launchctl load -w /System/Library/LaunchDaemons/ssh.plist
MonCompte ALL=(ALL) NOPASSWD: /bin/launchctl *
MonCompte ALL=(ALL) NOPASSWD: /bin/launchctl load -w /System/Library/LaunchDaemons/ssh.plist
MonCompte ALL=(ALL) NOPASSWD: /Chemin_dacces_a_mon_script/script.sh
Merci d'avance pour votre aide !