lenn@homl:~$ echo "lenn ALL=(ALL) NOPASSWD: /usr/bin/id" | sudo tee /etc/sudoers.d/1_my
[sudo] пароль для lenn:
lenn ALL=(ALL) NOPASSWD: /usr/bin/id
lenn@homl:~$ sudo -l
Matching Defaults entries for lenn on homl:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin
User lenn may run the following commands on homl:
(ALL : ALL) ALL
(ALL) ALL
(ALL) NOPASSWD: /usr/bin/id
lenn@homl:~$ sudo -k
lenn@homl:~$ sudo id
uid=0(root) gid=0(root) группы=0(root)
pfg@srv3:/$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/pfg/.ssh/id_rsa):
Created directory '/home/pfg/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/pfg/.ssh/id_rsa.
Your public key has been saved in /home/pfg/.ssh/id_rsa.pub.
если хоть один сингал (после тразнистора или внешний) будет нулем, то и на выходе будет ноль.