Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 10615  / 2 Years ago, fri, june 17, 2022, 1:34:03

su manual



http://manpages.ubuntu.com/manpages/precise/man1/su.1.html




The current environment is passed to the new shell.




Obviously you cant use su in Ubuntu as in su but it has to be always sudo susince the root user is disabled in Ubuntu but it seems this changes the abilities of the su command.



Any explanation?


More From » sudo

 Answers
2

I think I read somewhere that sudo does not pass along all environment variables on purpose, since that could be used to introduce root exploits (not unlike the recent bash bugs). Or you may need to use sudo with -E



 -E, --preserve-env
Indicates to the security policy that the user wishes to pre‐
serve their existing environment variables. The security
policy may return an error if the user does not have permis‐
sion to preserve the environment.


So you may have a different "security policy" set, somewhere. man sudo has more info, it appears to have more settings than just su does.


[#22213] Sunday, June 19, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jokaned

Total Points: 315
Total Questions: 116
Total Answers: 119

Location: Somalia
Member since Mon, Feb 27, 2023
1 Year ago
;