"sudo -l" 명령의 용도는 무엇입니까?

"sudo -l" 명령의 용도는 무엇입니까?

이것여기 링크는 슈퍼유저와 루트 사용자 사이에 차이가 없다고 언급하고 있으며 sudo 매뉴얼 페이지에 따르면

 -l, --list  If no command is specified, list the allowed (and forbidden)
             commands for the invoking user (or the user specified by the
             -U option) on the current host.  A longer list format is used
             if this option is specified multiple times and the security
             policy supports a verbose output format.

명령을 지정하지 않고 -l플래그를 사용하는 경우 호출하는 사용자에게 허용되거나 금지되는 명령 목록이 제공되어야 합니다. 그러나 루트가 아닌 사용자로 이것을 시도하면 오류 메시지가 나타납니다.

죄송합니다. 사용자 기생충은 Playbox에서 sudo를 실행하지 못할 수도 있습니다.

루트가 아닌 사용자로 이 명령을 실행할 수 없지만, 루트가 아닌 사용자로 이 명령을 실행할 수 없다면 무슨 소용이 있습니까?

답변1

글쎄, 그게 바로 말하는 것입니다. 호출하는 사용자가 허용하는(및 금지하는) 명령을 나열합니다. 당신은 실행할 수 있습니다 sudo -l. 그것이 당신에게 말하는 것입니다.

parasite귀하의 경우: 사용자는 sudo 명령을 실행할 수 없습니다. 시도하면 다음 sudo id메시지를 받게 됩니다.

parasite is not in the sudoers file.  This incident will be reported.

내 시스템에서는 다음으로 시작합니다 sudo -l.

User bigboss may run the following commands on verlaine:
   (ALL) NOPASSWD: ALL

sudo 명령을 활성화 하려면 parasite이 파일에 해당 명령을 추가해야 합니다 sudoers. 일반적으로 visudo이 작업을 수행하려면 루트로 실행합니다.

관련 정보