centos 尽管使用sudo,但仍要求管理特权?

axzmvihb  于 2022-11-08  发布在  其他
关注(0)|答案(1)|浏览(165)

我尝试使用以下命令解压缩文件,但遇到权限错误。

-bash-4.2$ unzip traccar-linux-*.zip && ./traccar.run
Archive:  traccar-linux-64-latest.zip
replace traccar.run? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
  inflating: traccar.run
  inflating: README.txt
Administrative privileges required for this archive (use su or sudo)

我的用户具有sudo“权限”

-bash-4.2$ sudo -l -U gc_admin
[sudo] password for gc_admin:
Matching Defaults entries for gc_admin on agitated-lewin:
    !visiblepw, always_set_home, match_group_by_gid, always_query_group_plugin,
    env_reset, env_keep="COLORS DISPLAY HOSTNAME HISTSIZE KDEDIR LS_COLORS",
    env_keep+="MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE",
    env_keep+="LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES",
    env_keep+="LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE",
    env_keep+="LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY",
    secure_path=/sbin\:/bin\:/usr/sbin\:/usr/bin

User gc_admin may run the following commands on agitated-lewin:
    (ALL) ALL

-bash-4.2$ groups gc_admin
gc_admin : psacln wheel

出于某种原因,即使有sudo命令,我也不允许解压?

-bash-4.2$ sudo unzip traccar-linux-*.zip && ./traccar.run
[sudo] password for gc_admin:
Archive:  traccar-linux-64-latest.zip
replace traccar.run? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
  inflating: traccar.run
  inflating: README.txt
Administrative privileges required for this archive (use su or sudo)

我做错了什么?有什么建议吗?

2uluyalo

2uluyalo1#

我想是我自己接的。
我尝试使用的命令(unzip traccar-linux-*.zip && ./traccar.run)由两部分组成。当单独运行时,都有自己的sudo命令,它工作得很好。

相关问题