Ctrl+C(^C)를 누른 후 sudo에서 다시 메시지를 표시하는 이유는 무엇입니까?

Ctrl+C(^C)를 누른 후 sudo에서 다시 메시지를 표시하는 이유는 무엇입니까?

잘못된 sudo 명령을 입력하고 이를 취소하고 싶을 때마다 Ctrl+ 를 사용합니다 C. 이전 Ubuntu 18 설치에서는 즉시 취소되고 프롬프트로 돌아갔습니다. 내 아치 시스템에서는 sudo 비밀번호를 다시 묻는 메시지가 표시되므로 명령 프롬프트를 취소하고 복원하려면 매번 비밀번호를 두 번 눌러야 합니다. 왜 이런 일이 발생합니까? 취소한 후 두 번째로 비밀번호를 묻는 메시지를 표시하지 않도록 할 수 있는 방법이 있나요?

[12:47:54]pintert3@~% sudo echo 'hello'
[sudo] password for pintert3:
[sudo] password for pintert3:
[12:48:40]pintert3@~%

이것은 내 /etc/sudoers파일입니다:

## sudoers file.
##
## This file MUST be edited with the 'visudo' command as root.
## Failure to use 'visudo' may result in syntax or file permission errors
## that prevent sudo from running.
##
## See the sudoers man page for the details on how to write a sudoers file.
##

##
## Host alias specification
##
## Groups of machines. These may include host names (optionally with wildcards),
## IP addresses, network numbers or netgroups.
# Host_Alias    WEBSERVERS = www1, www2, www3

##
## User alias specification
##
## Groups of users.  These may consist of user names, uids, Unix groups,
## or netgroups.
# User_Alias    ADMINS = millert, dowdy, mikef

##
## Cmnd alias specification
##
## Groups of commands.  Often used to group related commands together.
# Cmnd_Alias    PROCESSES = /usr/bin/nice, /bin/kill, /usr/bin/renice, \
#               /usr/bin/pkill, /usr/bin/top
Cmnd_Alias  REBOOT = /sbin/halt, /sbin/reboot, /sbin/poweroff

##
## Defaults specification
##
## You may wish to keep some of the following environment variables
## when running commands via sudo.
##
## Locale settings
# Defaults env_keep += "LANG LANGUAGE LINGUAS LC_* _XKB_CHARSET"
##
## Run X applications through sudo; HOME is used to find the
## .Xauthority file.  Note that other programs use HOME to find   
## configuration files and this may lead to privilege escalation!
# Defaults env_keep += "HOME"
##
## X11 resource path settings
# Defaults env_keep += "XAPPLRESDIR XFILESEARCHPATH XUSERFILESEARCHPATH"
##
## Desktop path settings
# Defaults env_keep += "QTDIR KDEDIR"
##
## Allow sudo-run commands to inherit the callers' ConsoleKit session
# Defaults env_keep += "XDG_SESSION_COOKIE"
##
## Uncomment to enable special input methods.  Care should be taken as
## this may allow users to subvert the command being run via sudo.
# Defaults env_keep += "XMODIFIERS GTK_IM_MODULE QT_IM_MODULE QT_IM_SWITCHER"
##
## Uncomment to use a hard-coded PATH instead of the user's to find commands
# Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
##
## Uncomment to send mail if the user does not enter the correct password.
# Defaults mail_badpass
##
## Uncomment to enable logging of a command's output, except for
## sudoreplay and reboot.  Use sudoreplay to play back logged sessions.
# Defaults log_output
# Defaults!/usr/bin/sudoreplay !log_output
# Defaults!/usr/local/bin/sudoreplay !log_output
# Defaults!REBOOT !log_output

##
## Runas alias specification
%wheel ALL=(ALL) NOPASSWD: REBOOT


##
## User privilege specification
##
root ALL=(ALL) ALL

## Uncomment to allow members of group wheel to execute any command
%wheel ALL=(ALL) ALL

## Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL

## Uncomment to allow members of group sudo to execute any command
# %sudo ALL=(ALL) ALL

## Uncomment to allow any user to run sudo if they know the password
## of the user they are running the command as (root by default).
# Defaults targetpw  # Ask for the password of the target user
# ALL ALL=(ALL) ALL  # WARNING: only use this together with 'Defaults targetpw'

## Read drop-in files from /etc/sudoers.d
## (the '#' here does not indicate a comment)
#includedir /etc/sudoers.d

# Reset environment by default
Defaults    env_reset
# Set default editor to vim, and do not allow visudo to use EDITOR/VISUAL
Defaults    editor=/usr/bin/vim,    !env_editor
Defaults passwd_timeout=0
#Defaults passprompt="[sudo] password for %p: "
Defaults timestamp_timeout=10
Defaults insults

답변1

그래서 댓글을 확인해보니 문제점이 발견되었습니다. 범인은 내 .zshrc의 sudo 별칭이었습니다. alias sudo='sudo -v; sudo';특별히 감사드립니다.제프 샬러,컴퓨터그리고프라산댓글로 도움을 요청하세요.

관련 정보