In Linux, how does one add a user to sudoers? Sometimes when we execute sudo, xxx is not int the sudoers file tells us that the current user is not sudoer, so we need to add the current user as follows: 1. Modify the/etc/sudoers file and enter the Super User. Because there is no write permission, add the write permission to chmod u + w/etc/sudoers first. 2. Edit the/etc/sudoers file and find this line: "root ALL = (ALL) ALL" add "zhc ALL = (ALL) ALL "(here zhc is your user name), and then save. 3. Finally, the system restores the write permission mode and revokes the write permission for the file. chmod u-w/etc/sudoers. Then we can use zhc users to edit the root file, such as vi/etc/sysconfig/network-scripts/ifcfg-eth0 after modification, can not be saved directly, because there is no permission, so we can execute: w! Sudo tee % This command inputs the Current Buffer content to stdin, then the tee command from standard input to standard output, and then another shunt to the file, Here % represents the current file.