Cause: Because the /etc/sudoers file was previously edited with a problem, the default Ubuntu system could not use sudo to raise power after saving, and could not use root privileges causing a big problem; the default Ubuntu system root was not allowed to log in, and the root login password had not been set before; sadly, it could not be modified by directly logging into the root account.
The problem is in /etc/sudoers: syntax error near line 32 of the sudoers file.
Solution.
1. open two shell windows with the normal user “ubuntu”.
2, in the first ssh session execute “echo $$” and write down the PID
3, in the second ssh session, execute “pkttyagent –process PID”.
4. Execute “pkexec visudo” in the first ssh session and then enter the password in the second ssh session. This will give you access to the /etc/sudoers file, then you will know the error line and modify the data.
5. Use the nano editor for editing by default.
1、Execute "Ctrl+O" #Save
2, after the implementation of "Ctrl + O", the output will be "File Name to Write sudoers.tmp", in tmp after the implementation of the carriage return *
3、Execute "Ctrl+X "* #Exit
At this time, when you open the shell link, you will not report an error when using sudo and Su rights raising behavior;
Read More:
- [Solved] bash: /etc/vimrc: line 15: syntax error near unexpected token `“autocmd“‘
- How to Solve Xmind Install Error in Ubuntu System
- Ubuntu shell Script syntax error near unexpected token `$‘{\r‘‘
- Ubuntu Server: How to Install Chrome
- Ubuntu Error: dpkg: error processing package mysql-community-server (–configure):
- [Solved] ubuntu Run jupyter Error: print(‘Error in generated code:‘, file=sys.stderr) SyntaxError: invalid syntax
- [Solved] keystone Install Error: Failed to parse /etc/keystone/keystone.conf: at /etc/keystone/keystone.conf:687
- [Solved] Ubuntu 20.04.3 Fail to Start sshd Error: Failed to start OpenBSD Secure Shell server
- System has not been booted with systemd as init system (PID 1). Can‘t operate
- redhat7. 5 system service is not started automatically and use systemctl start error: error getting authority: error initializing authority: CO, (the server will restart)
- Problem solving / etc/ rc.local The boot entry of the file configuration is invalid
- [Solved] docker Error: System has not been booted with systemd as init system (PID 1). Can‘t operate. Failed to con
- [Solved] yum command Error: “except keyboardinterrupt, e: syntax error: invalid syntax”“
- Nginx Error: Swap file “/etc/nginx/.nginx.conf.swp“ already exists
- hive: How to Process Data (Delete, View, Query, and etc)
- [Solved] source /etc/profile Error: not a valid identifier
- ./ungrib.exe Start Error: Could not Fould libpng16.so.16 (/etc/ld.so.conf and ldconfig)
- [Solved] Ubuntu 20.04 install MATLAB and toolbox permissions Error
- [Solved] Ubuntu: su Switch root Error: Authentication failure
- Shell Script syntax error near unexpected token `done’