mirror of
https://github.com/konstruktoid/hardening.git
synced 2026-04-26 09:15:55 +03:00
[GH-ISSUE #241] Question: su: Permision denied #69
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @esnavarro on GitHub (Feb 16, 2023).
Original GitHub issue: https://github.com/konstruktoid/hardening/issues/241
Originally assigned to: @konstruktoid on GitHub.
Describe the bug
su: Permission denied
Expected behavior
should be able to switch to another user account
System (lsb_release -a):
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy
Additional context
I decided to perform the automated security hardening for my ubuntu 22.04 server, after I run the script (ubuntu.sh) I encountered an unexpected error. When I tried to switch to another account using the "su -l username" command and input with the right password I received an error message su: Permission denied
Is there a way to revert back to its normal state(remove the hardening) using the script?
Thank you,
@konstruktoid commented on GitHub (Feb 16, 2023):
Hi @esnavarro, the restriction is set by https://github.com/konstruktoid/hardening/blob/master/scripts/rootaccess#L30.
I recommend you to use
sudo -i -u usernameinstead sincesuhas been superseded by sudo, which allows for better control regarding privileged access.