Not able to switch to root user via command line [duplicate] The 2019 Stack Overflow Developer...

Is it ok to offer lower paid work as a trial period before negotiating for a full-time job?

Do warforged have souls?

Accepted by European university, rejected by all American ones I applied to? Possible reasons?

Would an alien lifeform be able to achieve space travel if lacking in vision?

What other Star Trek series did the main TNG cast show up in?

Was credit for the black hole image misappropriated?

Is an up-to-date browser secure on an out-of-date OS?

How to read αἱμύλιος or when to aspirate

Could an empire control the whole planet with today's comunication methods?

how can a perfect fourth interval be considered either consonant or dissonant?

Using dividends to reduce short term capital gains?

Can withdrawing asylum be illegal?

Does Parliament need to approve the new Brexit delay to 31 October 2019?

How to politely respond to generic emails requesting a PhD/job in my lab? Without wasting too much time

ELI5: Why do they say that Israel would have been the fourth country to land a spacecraft on the Moon and why do they call it low cost?

Identify 80s or 90s comics with ripped creatures (not dwarves)

Button changing its text & action. Good or terrible?

What is the padding with red substance inside of steak packaging?

Can the Right Ascension and Argument of Perigee of a spacecraft's orbit keep varying by themselves with time?

What was the last x86 CPU that did not have the x87 floating-point unit built in?

What force causes entropy to increase?

How do you keep chess fun when your opponent constantly beats you?

Why doesn't a hydraulic lever violate conservation of energy?

"... to apply for a visa" or "... and applied for a visa"?



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



The 2019 Stack Overflow Developer Survey Results Are In
Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar Manara
2019 Community Moderator Election ResultsHow 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 2 hours ago


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
    7 hours ago











  • 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
    7 hours ago













  • 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
    7 hours ago











  • 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
    7 hours ago








  • 1





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

    – DopeGhoti
    7 hours ago


















-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 2 hours ago


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
    7 hours ago











  • 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
    7 hours ago













  • 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
    7 hours ago











  • 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
    7 hours ago








  • 1





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

    – DopeGhoti
    7 hours ago














-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 7 hours ago







Erdem Ece

















asked 7 hours ago









Erdem EceErdem Ece

209249




209249




marked as duplicate by ctrl-alt-delor, Kusalananda 2 hours ago


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 2 hours ago


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
    7 hours ago











  • 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
    7 hours ago













  • 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
    7 hours ago











  • 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
    7 hours ago








  • 1





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

    – DopeGhoti
    7 hours ago



















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

    – LL3
    7 hours ago











  • 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
    7 hours ago













  • 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
    7 hours ago











  • 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
    7 hours ago








  • 1





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

    – DopeGhoti
    7 hours ago

















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

– LL3
7 hours ago





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

– LL3
7 hours ago













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
7 hours ago







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
7 hours ago















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
7 hours ago





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
7 hours ago













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
7 hours ago







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
7 hours ago






1




1





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

– DopeGhoti
7 hours ago





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

– DopeGhoti
7 hours ago










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
    7 hours ago













  • 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
    7 hours ago


















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
    7 hours ago













  • 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
    7 hours ago
















-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
    7 hours ago













  • 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
    7 hours ago














-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 7 hours ago









DopeGhotiDopeGhoti

47.1k56190




47.1k56190













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

    – Erdem Ece
    7 hours ago













  • 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
    7 hours ago



















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

    – Erdem Ece
    7 hours ago













  • 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
    7 hours ago

















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

– Erdem Ece
7 hours ago







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

– Erdem Ece
7 hours ago















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
7 hours ago





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
7 hours ago



Popular posts from this blog

Hudson River Historic District Contents Geography History The district today Aesthetics Cultural...

The number designs the writing. Feandra Aversely Definition: The act of ingrafting a sprig or shoot of one...

Ayherre Geografie Demografie Externe links Navigatiemenu43° 23′ NB, 1° 15′ WL43° 23′ NB, 1°...