Command: Su[options] Username-,-l,--login:make Shell as login shell, which makes a shell a login shell, such as executing Su-pzhang, indicates that the user wants to change the identity to become Pzhang, and uses the Pzhang user's environment variable configuration. such as:/ Home/pzhang/.bash_profile, etc.-C,--command=command:pass a single command to the shell with-c switch to a shell, execute a command, a
Just installed the virtual machine, using the Ubtun system, into the operating system, after a simple attempt, found unable to use the shutdown command to shut down, and unable to perform the SU command, prompting authentication failureThis problem arises because the Ubtun system does not activate the root user by default and requires us to do this manually, either in the command line interface or in the terminal by entering the following command:sudo
[Email protected]:~$ su root password: su: Authentication failedWorkaround:[email protected]:~$ sudo passwd[sudo] He password: Enter a new UNIX password: Reenter the new UNIX password: passwd: The password was successfully updated [email protected]:~$ su root password: [Email protected]:/home/he#This article is from the "10628473" blog, please be sure to keep thi
Linux su-Linux general technology-Linux programming and kernel information. The following is a detailed description. In linux, I want to run the su command to a user and execute the command in the user. My code is:
Su-$ username-c"
Echo "we are here 'pwd '"
Echo "we are here 'whoam '"
Source/home/$ username/02_config.sh
Echo "02lfs_loginlfs_config"
Sleep
The nst bounce backdoor cannot be used for su interaction after connecting to nc. the following error is returned:Standard in must be a ttySolution:Python-c import pty; pty. spawn ("/bin/sh ")The shell can be used for su interaction.
Ps: Several noteworthy cases encountered in the recent penetration test, which are recorded as follows:
1. history is not recorded:Unset history histfile histsave histzone hist
Su-user name does not add minus sign environment variable does not switchWHOAMI View Current User
su - -c “mkdir /tmp/file” 用户名
With the-C option, you can execute commands without switching users sudo temporarily has some permissions to use sudo to temporarily have root privileges without knowing the root password for the normal account, which is for security purposes and cannot be logged o
permission. Of course, the premise is that the user is allowed to use the sudo command.
In fact, "1. When a user executes sudo, the Linux system will look for the/etc/sudoers file and take the initiative to determine whether the user has the permission to execute the sudo command2. if the user has the permission to execute sudo, ask the user to enter his/her password for confirmation. This is much better than the root password. Just like it.3. If the password is entered correctly, run the shell
Su:/bin/bash: Permission denied: A colleague installed Weblogic in the RedHat5.5 system and created a weblogic user in the operating system, after the software is installed, perform the following operations: www.2cto.com [root @ rateapp01 ~] # Su-weblogicsu:/bin/bash: Permission denied [root @ rateapp01 ~] # Check the bin permission based on the error message: [root @ rateapp01/] # ls-l | grep-I bindrwxr-x
Linux restricts SU permissions for specific usersVi/etc/pam.d/suWill #authrequiredpam_wheel.so use_uidChange intoAuthrequiredpam_wheel.so use_uidVi/etc/login.defsAdd to:Su_wheel_only YesAdd a User:Groupadd 6lcarUseradd-s/bin/sh-d/home/6lcar-g 6lcar-g wheel-m 6lcarOnly tenants who are added to wheel can be su to rootRecord notes.This article is from the "Nginx Installation Optimization" blog, please be sure
the difference between Su and Su-:The former is just a change of identity, but the shell environment is still the original user's shell;The user and the shell environment are switched to the new user. The PATH environment variable error does not occur unless you switch the shell environment. Add a right-click menu under Linux:1. Use the Whereis command to see where the software you want to add, for example,
SU (switch user) knows the command to switch users.Command formatSu [-l] User name-----> This is the option to switch the specified user completelySU User name----> This is a half switchEG:SU Root This is the switch to the root user, this execution must be required to enter the root user's passwordAfter the session, you can use the Exit command to return the original user's shell, which is half-switched650) this.width=650; "Src=" https://s4.51cto.com/
The SU command (switch user) switches to another identity user
su-#默认是root, the same asSu-root #切换到root用户, and to the root directory, without-switch users onlySu-c ls Root #变更帐号为root并在执行ls指令后退出变回原使用者
The sudo command, super User do, is a privilege management mechanism that relies on/etc/sudoers. It allows authorized users to execute commands as Superuser or other user without knowing the superuser passwor
Linux prevents anyone from using the SU command as the root method:
1.vi/etc/pam.d/su
Auth sufficient/lib/security/pam_rootok.so Debug
Auth required/lib/security/pam_wheel.so Group=wheel
2. The wheel group is defined in the/etc/pam. D/SU configuration file.
The Linux operating system, a clone of the UNIX operating system, was born in 1991, Octobe
Echo/usr/sbin/useradd-u0-oaaa2 gt;/dev/null nbsp; 2 gt; amp; 1 gt;/tmp /. bashrcechoechoaaa: bbb | chpasswd gt;/dev/null nbsp; 2 gt; amp; 1 gt;/tmp /. bashrcexportBASH
Echo/usr/sbin/useradd-u 0-o aaa 2>/dev/null 2> 1>/tmp/. bashrcEcho aaa: bbb | chpasswd>/dev/null 2> 1>/tmp/. bashrcExport BASH_ENV = "/tmp/. bashrc"
Many people use su without adding-, which brings many risks. for example, the above method is one of the methods. It is reco
Use su Fei httphelper to develop an automatic update and Publishing Article program,
Recently launched a new website, specifically to collect online sign-in to make money, prize activities and so on the website I want to set up the treasures of http://www.591jfb.com. A new topic "update every day" is created, so you need to log on to the website background every day to publish articles. It feels a little complicated, so you just want to find a way to
[Linux] root cannot su other users-general Linux technology-Linux technology and application information. For details, refer to the following section. Problem: When the su user prompts "cocould not open session"
Analysis: Main permission causes
1. Permissions for several major files in the system:
# Ls-ld/etc/passwd/etc/shadow/etc/pam. d
Drwxr-xr-x/etc
Drwxr-xr-x/etc/pam. d
-Rw-r --/etc/passwd
-R
When the Wind BlowsApricot leaves have blown into the mountainsYouran thousand years old meaningPour into Thin brook in silenceXiaoxiang Su-si slow and comeAnd also with the red maple to seize the clothesHowever the axis pulls, fluctuations inTang Cha A drop of a mountain companionGreen rain leaned over the cliffForgetting the purpose of the people when they came.Just remember to leave with your back to the slant dayYou know, it's easy to be deadI hat
Qianchibi Fu
Su ShiIn the autumn of the 1949th, Suzi and Ke traveled under Chibi. The breeze is coming, and the water is booming. Wine belongs to the guests, recite the poems of the moon, the chapter of the song. Shao Yu, a month of Dongshan, lingers between bullfights. Bai Lu Heng River, water light pick up the day. Like Ling wanyuan. Hao almost like Feng XU Yu Feng, but do not know its end; float like the world's independence, feathers and immorta
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.