2020年3月12日 星期四

自己創建 ubuntu rootfs 18.04 遇到 sudo su error

sudo su error


如果執行sudo命令的用戶沒有執行sudo的權限,執行sudo命令時會報下面的錯
*** error: sudo: unable to resolve host localhost.localdomain
    修正 /etc/hosts
    增加 127.0.0.1       localhost.localdomain
    重啟服務 Ubuntu: $sudo/etc/init.d/networking restart

*** error: accusys is not in the sudoers file. This incident will be reported.
    #su root
    #chmod u+w /etc/sudoers
    #vi /etc/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:/snap/bin"
     
        # Host alias specification
     
        # User alias specification
     
        # Cmnd alias specification
     
        # User privilege specification
        root    ALL=(ALL:ALL) ALL
        accusys 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
 
    #chmod u-w /etc/sudoers

沒有留言:

張貼留言