运行“sudo dmidecode”时我得到以下输出:
johnny@johns-laptop:~$ sudo dmidecode
# dmidecode 2.12
# SMBIOS entry point at 0xa9e84010
/dev/mem: Operation not permitted
johnny@johns-laptop:~$
搜索该主题仅会产生请求者想要以非 root 身份访问 /dev/mem 的线程,或者尝试执行比这更复杂的事情的线程。
背景是 - 大约 2 个月前,我的桌面在软件更新后根本无法启动,我通过创建另一个用户并复制文件解决了这个问题。所以当我用 root 权限设置新用户名时,可能我做得不够彻底...
我认为我的经验水平是菜鸟级的。
sudoers 文件...
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
johnny@johns-laptop:~$ ls -l /dev/mem
crw-r----- 1 root kmem 1, 1 Dec 20 09:22 /dev/mem
johnny@johns-laptop:~$ lsattr /dev/mem
lsattr: Operation not supported While reading flags on /dev/mem
johnny@johns-laptop:~$ ^C
johnny@johns-laptop:~$