Not able to switch to root user via command line [duplicate] Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election Results Why I closed the “Why is Kali so hard” questionHow to allow to run su instantly after I added the user to the appropriate groupProper create user account with permissions on CentOS/ApacheSUID accidently removed from /bin/su fileWhy does 'cat useradd' succeed in this case?This user is currently not available - but allow to run script by this userHow to enable quota on CENTOS 6.9 virtuozzo VPS?Launching zypper command with root privilegePermission and directory creation issues as root user on CentOSssh login as user and change to root, without sudoLinux giving permission to an user to the log fileCould not chdir to home directory /home/user: Permission denied

How to tell that you are a giant?

Are two submodules (where one is contained in the other) isomorphic if their quotientmodules are isomorphic?

prime numbers and expressing non-prime numbers

What does the word "veer" mean here?

Should I use a zero-interest credit card for a large one-time purchase?

How would the world control an invulnerable immortal mass murderer?

What is a non-alternating simple group with big order, but relatively few conjugacy classes?

How to run gsettings for another user Ubuntu 18.04.2 LTS

String `!23` is replaced with `docker` in command line

Output the ŋarâþ crîþ alphabet song without using (m)any letters

How can I make names more distinctive without making them longer?

Why did the Falcon Heavy center core fall off the ASDS OCISLY barge?

Why do people hide their license plates in the EU?

Why are there no cargo aircraft with "flying wing" design?

What's the meaning of 間時肆拾貳 at a car parking sign

Coloring maths inside a tcolorbox

Is there a (better) way to access $wpdb results?

How to deal with a team lead who never gives me credit?

Why is my conclusion inconsistent with the van't Hoff equation?

List of Python versions

Storing hydrofluoric acid before the invention of plastics

Why did the IBM 650 use bi-quinary?

How does the particle を relate to the verb 行く in the structure「A を + B に行く」?

Resolving to minmaj7



Not able to switch to root user via command line [duplicate]



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Community Moderator Election Results
Why I closed the “Why is Kali so hard” questionHow to allow to run su instantly after I added the user to the appropriate groupProper create user account with permissions on CentOS/ApacheSUID accidently removed from /bin/su fileWhy does 'cat useradd' succeed in this case?This user is currently not available - but allow to run script by this userHow to enable quota on CENTOS 6.9 virtuozzo VPS?Launching zypper command with root privilegePermission and directory creation issues as root user on CentOSssh login as user and change to root, without sudoLinux giving permission to an user to the log fileCould not chdir to home directory /home/user: Permission denied



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








-1
















This question already has an answer here:



  • How to allow to run su instantly after I added the user to the appropriate group

    1 answer



On my centos 7 vps server, to secure my server I disabled root login via ssh. I created a new user called erdem and login with that user via ssh. After I login via ssh with user erdem, I would like to switch to root user with su command or su -s command. When I do that I get this error:



-bash: /usr/bin/su: Permission denied


How can I give permission to user called erdem so I can switch with su or su -s command to root.



The output of ls -l /usr/bin/su:



 -rwsr-x--- 1 root wheel /usr/bin/su


I tried to add the user into wheel group but it still gives the same error.



I used bellow command



gpasswd -a erdem wheel


Solved: I needed to logout and login again.










share|improve this question















marked as duplicate by ctrl-alt-delor, Kusalananda Apr 12 at 21:27


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


















  • Error apart, what you want to obtain is more commonly done via sudo -s. Doesn’t it work for you ?

    – LL3
    Apr 12 at 16:06











  • su is also a valid means to become root, particularly if sudo is not yet installed, or the newly-created non-root user is not yet in sudoers. OP, can you please add the output of the following to your question: ls -l /usr/bin/su

    – DopeGhoti
    Apr 12 at 16:13












  • when I do that it asks for a password for the user and when I type it I get this message erdem is not in the sudoers file. This incident will be reported.

    – Erdem Ece
    Apr 12 at 16:13











  • su expects the target user's password (root in this case). sudo expects the password of the user executing the command (yours). su on some systems can only be executed by users in particular groups (wheel on BSD, for example), but I'm unsure how this works on CentOS.

    – Kusalananda
    Apr 12 at 16:14







  • 1





    Please add details by editing the question, not by adding them to the comments.

    – DopeGhoti
    Apr 12 at 16:24

















-1
















This question already has an answer here:



  • How to allow to run su instantly after I added the user to the appropriate group

    1 answer



On my centos 7 vps server, to secure my server I disabled root login via ssh. I created a new user called erdem and login with that user via ssh. After I login via ssh with user erdem, I would like to switch to root user with su command or su -s command. When I do that I get this error:



-bash: /usr/bin/su: Permission denied


How can I give permission to user called erdem so I can switch with su or su -s command to root.



The output of ls -l /usr/bin/su:



 -rwsr-x--- 1 root wheel /usr/bin/su


I tried to add the user into wheel group but it still gives the same error.



I used bellow command



gpasswd -a erdem wheel


Solved: I needed to logout and login again.










share|improve this question















marked as duplicate by ctrl-alt-delor, Kusalananda Apr 12 at 21:27


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


















  • Error apart, what you want to obtain is more commonly done via sudo -s. Doesn’t it work for you ?

    – LL3
    Apr 12 at 16:06











  • su is also a valid means to become root, particularly if sudo is not yet installed, or the newly-created non-root user is not yet in sudoers. OP, can you please add the output of the following to your question: ls -l /usr/bin/su

    – DopeGhoti
    Apr 12 at 16:13












  • when I do that it asks for a password for the user and when I type it I get this message erdem is not in the sudoers file. This incident will be reported.

    – Erdem Ece
    Apr 12 at 16:13











  • su expects the target user's password (root in this case). sudo expects the password of the user executing the command (yours). su on some systems can only be executed by users in particular groups (wheel on BSD, for example), but I'm unsure how this works on CentOS.

    – Kusalananda
    Apr 12 at 16:14







  • 1





    Please add details by editing the question, not by adding them to the comments.

    – DopeGhoti
    Apr 12 at 16:24













-1












-1








-1









This question already has an answer here:



  • How to allow to run su instantly after I added the user to the appropriate group

    1 answer



On my centos 7 vps server, to secure my server I disabled root login via ssh. I created a new user called erdem and login with that user via ssh. After I login via ssh with user erdem, I would like to switch to root user with su command or su -s command. When I do that I get this error:



-bash: /usr/bin/su: Permission denied


How can I give permission to user called erdem so I can switch with su or su -s command to root.



The output of ls -l /usr/bin/su:



 -rwsr-x--- 1 root wheel /usr/bin/su


I tried to add the user into wheel group but it still gives the same error.



I used bellow command



gpasswd -a erdem wheel


Solved: I needed to logout and login again.










share|improve this question

















This question already has an answer here:



  • How to allow to run su instantly after I added the user to the appropriate group

    1 answer



On my centos 7 vps server, to secure my server I disabled root login via ssh. I created a new user called erdem and login with that user via ssh. After I login via ssh with user erdem, I would like to switch to root user with su command or su -s command. When I do that I get this error:



-bash: /usr/bin/su: Permission denied


How can I give permission to user called erdem so I can switch with su or su -s command to root.



The output of ls -l /usr/bin/su:



 -rwsr-x--- 1 root wheel /usr/bin/su


I tried to add the user into wheel group but it still gives the same error.



I used bellow command



gpasswd -a erdem wheel


Solved: I needed to logout and login again.





This question already has an answer here:



  • How to allow to run su instantly after I added the user to the appropriate group

    1 answer







centos permissions su






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 12 at 16:31







Erdem Ece

















asked Apr 12 at 15:56









Erdem EceErdem Ece

2092410




2092410




marked as duplicate by ctrl-alt-delor, Kusalananda Apr 12 at 21:27


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by ctrl-alt-delor, Kusalananda Apr 12 at 21:27


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • Error apart, what you want to obtain is more commonly done via sudo -s. Doesn’t it work for you ?

    – LL3
    Apr 12 at 16:06











  • su is also a valid means to become root, particularly if sudo is not yet installed, or the newly-created non-root user is not yet in sudoers. OP, can you please add the output of the following to your question: ls -l /usr/bin/su

    – DopeGhoti
    Apr 12 at 16:13












  • when I do that it asks for a password for the user and when I type it I get this message erdem is not in the sudoers file. This incident will be reported.

    – Erdem Ece
    Apr 12 at 16:13











  • su expects the target user's password (root in this case). sudo expects the password of the user executing the command (yours). su on some systems can only be executed by users in particular groups (wheel on BSD, for example), but I'm unsure how this works on CentOS.

    – Kusalananda
    Apr 12 at 16:14







  • 1





    Please add details by editing the question, not by adding them to the comments.

    – DopeGhoti
    Apr 12 at 16:24

















  • Error apart, what you want to obtain is more commonly done via sudo -s. Doesn’t it work for you ?

    – LL3
    Apr 12 at 16:06











  • su is also a valid means to become root, particularly if sudo is not yet installed, or the newly-created non-root user is not yet in sudoers. OP, can you please add the output of the following to your question: ls -l /usr/bin/su

    – DopeGhoti
    Apr 12 at 16:13












  • when I do that it asks for a password for the user and when I type it I get this message erdem is not in the sudoers file. This incident will be reported.

    – Erdem Ece
    Apr 12 at 16:13











  • su expects the target user's password (root in this case). sudo expects the password of the user executing the command (yours). su on some systems can only be executed by users in particular groups (wheel on BSD, for example), but I'm unsure how this works on CentOS.

    – Kusalananda
    Apr 12 at 16:14







  • 1





    Please add details by editing the question, not by adding them to the comments.

    – DopeGhoti
    Apr 12 at 16:24
















Error apart, what you want to obtain is more commonly done via sudo -s. Doesn’t it work for you ?

– LL3
Apr 12 at 16:06





Error apart, what you want to obtain is more commonly done via sudo -s. Doesn’t it work for you ?

– LL3
Apr 12 at 16:06













su is also a valid means to become root, particularly if sudo is not yet installed, or the newly-created non-root user is not yet in sudoers. OP, can you please add the output of the following to your question: ls -l /usr/bin/su

– DopeGhoti
Apr 12 at 16:13






su is also a valid means to become root, particularly if sudo is not yet installed, or the newly-created non-root user is not yet in sudoers. OP, can you please add the output of the following to your question: ls -l /usr/bin/su

– DopeGhoti
Apr 12 at 16:13














when I do that it asks for a password for the user and when I type it I get this message erdem is not in the sudoers file. This incident will be reported.

– Erdem Ece
Apr 12 at 16:13





when I do that it asks for a password for the user and when I type it I get this message erdem is not in the sudoers file. This incident will be reported.

– Erdem Ece
Apr 12 at 16:13













su expects the target user's password (root in this case). sudo expects the password of the user executing the command (yours). su on some systems can only be executed by users in particular groups (wheel on BSD, for example), but I'm unsure how this works on CentOS.

– Kusalananda
Apr 12 at 16:14






su expects the target user's password (root in this case). sudo expects the password of the user executing the command (yours). su on some systems can only be executed by users in particular groups (wheel on BSD, for example), but I'm unsure how this works on CentOS.

– Kusalananda
Apr 12 at 16:14





1




1





Please add details by editing the question, not by adding them to the comments.

– DopeGhoti
Apr 12 at 16:24





Please add details by editing the question, not by adding them to the comments.

– DopeGhoti
Apr 12 at 16:24










1 Answer
1






active

oldest

votes


















-1














The permissions for su look abnormal to me. Here are the permissions I see on another CentOS machine:



-rwsr-xr-x. 1 root root 32208 Mar 14 10:37 /usr/bin/su


Note that your copy of su does not have the execute permission for users not in the wheel group, who are not already the root user.



On your system, no one will be able to su even knowing the root password if they are not in the wheel group.






share|improve this answer























  • after adding the user wheel group I didn't know I needed to logout and login again. Thanks.

    – Erdem Ece
    Apr 12 at 16:31












  • This is the traditional way. The purpose of group wheel is to be able to use su to change to root. I think the check was originally in the command, as doing it this way prevents users switching to another non-root user (with password).

    – ctrl-alt-delor
    Apr 12 at 16:36

















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









-1














The permissions for su look abnormal to me. Here are the permissions I see on another CentOS machine:



-rwsr-xr-x. 1 root root 32208 Mar 14 10:37 /usr/bin/su


Note that your copy of su does not have the execute permission for users not in the wheel group, who are not already the root user.



On your system, no one will be able to su even knowing the root password if they are not in the wheel group.






share|improve this answer























  • after adding the user wheel group I didn't know I needed to logout and login again. Thanks.

    – Erdem Ece
    Apr 12 at 16:31












  • This is the traditional way. The purpose of group wheel is to be able to use su to change to root. I think the check was originally in the command, as doing it this way prevents users switching to another non-root user (with password).

    – ctrl-alt-delor
    Apr 12 at 16:36















-1














The permissions for su look abnormal to me. Here are the permissions I see on another CentOS machine:



-rwsr-xr-x. 1 root root 32208 Mar 14 10:37 /usr/bin/su


Note that your copy of su does not have the execute permission for users not in the wheel group, who are not already the root user.



On your system, no one will be able to su even knowing the root password if they are not in the wheel group.






share|improve this answer























  • after adding the user wheel group I didn't know I needed to logout and login again. Thanks.

    – Erdem Ece
    Apr 12 at 16:31












  • This is the traditional way. The purpose of group wheel is to be able to use su to change to root. I think the check was originally in the command, as doing it this way prevents users switching to another non-root user (with password).

    – ctrl-alt-delor
    Apr 12 at 16:36













-1












-1








-1







The permissions for su look abnormal to me. Here are the permissions I see on another CentOS machine:



-rwsr-xr-x. 1 root root 32208 Mar 14 10:37 /usr/bin/su


Note that your copy of su does not have the execute permission for users not in the wheel group, who are not already the root user.



On your system, no one will be able to su even knowing the root password if they are not in the wheel group.






share|improve this answer













The permissions for su look abnormal to me. Here are the permissions I see on another CentOS machine:



-rwsr-xr-x. 1 root root 32208 Mar 14 10:37 /usr/bin/su


Note that your copy of su does not have the execute permission for users not in the wheel group, who are not already the root user.



On your system, no one will be able to su even knowing the root password if they are not in the wheel group.







share|improve this answer












share|improve this answer



share|improve this answer










answered Apr 12 at 16:27









DopeGhotiDopeGhoti

47.2k56191




47.2k56191












  • after adding the user wheel group I didn't know I needed to logout and login again. Thanks.

    – Erdem Ece
    Apr 12 at 16:31












  • This is the traditional way. The purpose of group wheel is to be able to use su to change to root. I think the check was originally in the command, as doing it this way prevents users switching to another non-root user (with password).

    – ctrl-alt-delor
    Apr 12 at 16:36

















  • after adding the user wheel group I didn't know I needed to logout and login again. Thanks.

    – Erdem Ece
    Apr 12 at 16:31












  • This is the traditional way. The purpose of group wheel is to be able to use su to change to root. I think the check was originally in the command, as doing it this way prevents users switching to another non-root user (with password).

    – ctrl-alt-delor
    Apr 12 at 16:36
















after adding the user wheel group I didn't know I needed to logout and login again. Thanks.

– Erdem Ece
Apr 12 at 16:31






after adding the user wheel group I didn't know I needed to logout and login again. Thanks.

– Erdem Ece
Apr 12 at 16:31














This is the traditional way. The purpose of group wheel is to be able to use su to change to root. I think the check was originally in the command, as doing it this way prevents users switching to another non-root user (with password).

– ctrl-alt-delor
Apr 12 at 16:36





This is the traditional way. The purpose of group wheel is to be able to use su to change to root. I think the check was originally in the command, as doing it this way prevents users switching to another non-root user (with password).

– ctrl-alt-delor
Apr 12 at 16:36



Popular posts from this blog

getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

Marilyn Monroe Ny fiainany manokana | Jereo koa | Meny fitetezanafanitarana azy.