Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Looks like su doesn't work if USERNAME has no shell defined (or /bin/false) whereas sudo does work. Commented Jan 16, 2013 at 21:24
  • 1
    @Aif If the user is not allowed to run interactive commands, then the default behaviour su will reflect that. However, one can always override that using the -s switch. Note that the purpose of su is to mimic a given user's behaviour - which is normally influenced by his/her shell. By contrast, sudo would (by default) ignore target user's shell setting. Commented Jan 17, 2013 at 0:37
  • No, please don't run things using a shell simply to drop privileges. That leaves far too much in the control of an attacker, reading in various config files you don't want to be touching. Commented Feb 22, 2013 at 22:37