Recently has been looking at how to create sudo user and free of sudo password, found a lot of information, the results found is not OK. And I cracked it today!Environment: CentOS 6.61. First you have a regular user who executes sudo.[Email protected] ~]# useradd Chengcai2. Log in as root, and then modify the/etc/sudoers file:Vim/etc/sudoers######################
Linux Command sudo, linux Command sudo
The sudo command allows common users to perform operations as root without knowing the root password.
When executing a command in sudo, you only need to enter your own password to let sudo know that you are a normal person, then you
When executing scripts using different accounts, sudo will often encounter sudo: Sorry, you must have a tty to run sudo. In fact, just modify the sudo configuration.
VI/etc/sudoers (it is best to use the mongodo command)
Comment out the default requiretty line
# Default requiretty
This means that
In Ubuntu, the sudoers permission cannot be changed by mistake (you can retrieve the sudo permission when you forget the root password). because the sudoers permission is modified, sudo cannot be used, the Ubuntu root password is not set, and the result can only be modified in single-user mode (with root power...
In Ubuntu, the sudoers permission cannot be changed by mistake (you can retrieve the
Examples of sudo commands and sudo command examples
Sudo: authorize normal users to execute a command and run it as a specified user.
Configure sudu, enter the command mongodo, find the target line, and edit the configuration file under the target line.
, The first column writes the common user, the second column ALL = ([user name]) who is the user name, t
Linux users cannot use the sudo command. linux users use the sudo command.
The newly created sudo command cannot be used. The following message is displayed:
Xiaojing is not in the sudoers file. This incident will be reported
It turns out that the newly created user is not in the sudoers management file, so it is not enough to add it to it. The following metho
sudo apt-get upgrade: Does not have a significant impact on the system and can be run at any time.sudo apt-get Dist-upgrade: involves the core of the upgrade, usually has a real impact on the system functions, may be required to uninstall some installed software may also install some additional software, usually should be cautious operation, especially with unfinished work, However, you should try to upgrade as much as you allow, and you should be abl
Xbox ."
Installation:
-Try xbmc live CD:
Xbmc come also come in a live CD for people that like to testApplications before to install, you can download and run the booableLive CD from this link. Also if you want to run the xbmc from a USB drive, check out unetbootinTo create a bootable flash drive.
Download the live CD from this link.
-Installation in Ubuntu and linuxmint:
To install xbmc in Ubuntu 10.10 maverick meerkat and linuxmint10Julia, first we need to install some dependencies, to do t
Install JDK 6 first
Sudo apt-Get install sun-java6-jdk
Then you need to set the default JavaProgramSudo Update-alternatives -- config JavaEnter the corresponding options as prompted, and set them to JDK 6.
The following settingsSudo Vim/etc/environment
Add the following two lines:Classpath =/usr/lib/JVM/Java-6-sun/libJava_home =/usr/lib/JVM/Java-6-sunIf classpath and java_home are already set, change them to the above format and press ZZ
sudo apt-get updateThis command accesses each URL in the source list and reads the software listing, which is then saved on the local computer. The list of software that we see in the newly made Package manager is updated with the update command.After the update, you may need to upgrade.sudo apt-get upgradeThis command will compare the locally installed software with the software listed in the software list you just downloaded, and if you find that th
In Ubuntu, the sudoers permission cannot be changed by mistake (you can retrieve the sudo permission when you forget the root password). Because the sudoers permission is modified, sudo cannot be used, it happens that the Ubuntu root password is not set, and the result can only be modified in the single-user mode (with root power). In Ubuntu, during the boot, press shift to display various modes. Select the
Forward: http://blog.csdn.net/hejinjing_tom_com/article/details/7767127avoid ' sudo echo x > ' when ' Permission denied 'A : Examplesudo echo a > 1.txt-bash:1.txt:permission deniedB: Analysis:Bash refuses to do so, saying it has insufficient authority.This is because the redirect symbol ">" is also a bash command. sudo just lets the echo command have root privileges,However, the ">" command has no root priv
sudo: temporarily switch to Superuser mode to perform superuser privileges, prompting for a password that is the current user's password, not the password for the super account. However there is a time limit, Ubuntu defaults to 15 minutes for one time.SU: Switch to a certain user mode, prompted to enter the password when the password is Switched account password, the use of "SU account name." If the system defaults to the root account when no account
Exception:Traceback (most recent):File "/library/python/2.7/site-packages/pip/basecommand.py", line 215, in mainStatus = Self.run (options, args)File "/library/python/2.7/site-packages/pip/commands/install.py", line 342, in runPrefix=options.prefix_path,File "/library/python/2.7/site-packages/pip/req/req_set.py", line 778, in installRequirement.uninstall (Auto_confirm=true)File "/library/python/2.7/site-packages/pip/req/req_install.py", line 754, in UninstallPaths_to_remove.remove (auto_confirm)
assume that neither command has permission to write information to the TEST.ASC file. There are two ways to solve this problem. The first is to use the "sh-c" command, which allows bash to execute a string as a complete command, so that the scope of sudo can be extended to the entire command. The specific usage is as follows: $sudo sh-c "Echo ' another line of information ' >> TEST.ASC"this way
enough. This is because the redirection symbols ">" and ">" are also bash commands. We only use sudo to grant root permissions to echo commands, but do not allow ">" and ">" commands to have root permissions, so bash will think that neither of these two commands is like test. the permission to write information to asc files.
There are two ways to solve this problem. The first is to use the "sh-c" command, which allows bash to execute a string as a co
Cases
1 sudo "echo" [Yaf] ' >/usr/local/php/etc/include/yaf.ini '
2 #Permission denied insufficient privileges
When using sudo echo ' xxx ' >/path/file, sudo is used only on ECHO, and redirection does not use sudo permission, so there will be "Permission denied" situation, the solution is very simple, is a parameter
[vim] with sudo permission to save vim open readonly file
The following command is to be stated in this article:
: W! sudo tee% >/dev/null
In the Linux configuration, you will change to read-only files, such as/etc/profile
$ ls-al/etc/profile-rw-r–r–1 root root 1139 Mar 17:30/etc/profile
Use VIM to open the file/etc/profile modified, save will be wrong:
: WE45:
In the maintenance of online services, often to edit some files that do not belong to the operation of the user, that is, only the type of R permission, each save will prompt read only. Can only be noted to change what, and then quit, and then sudo vim to do the save.The following command can not exit the VIM process, directly with the VIM command to get sudo permissions, and then directly save the file.
"Sudo" is a very useful tool on the Unix/linux platform that allows system administrators to assign some reasonable "rights" to ordinary users to perform tasks that only superuser or other privileged users can accomplish, such as running some commands like MOUNT,HALT,SU. , or edit some system configuration files, such as/etc/mtab,/etc/samba/smb.conf, etc. This has not only reduced the number of logins and administrative time of the root user, but also
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.