{"id":183,"date":"2009-11-19T23:01:00","date_gmt":"2009-11-19T23:01:00","guid":{"rendered":"https:\/\/www.root42.de\/blog\/?p=183"},"modified":"2009-11-19T23:01:00","modified_gmt":"2009-11-19T23:01:00","slug":"sudo-vs-su","status":"publish","type":"post","link":"https:\/\/www.root42.de\/blog\/?p=183","title":{"rendered":"sudo vs su"},"content":{"rendered":"<p>Today I updated my home machine, running OpenSUSE 11.1 at the moment (yeah, I know 11.2 is out, but I always wait a couple of months, for the first round of updates to settle in). I got used so much to OS X&#8217;s and Ubuntu&#8217;s style of not having an explicit root user, that I wanted to emulate it in OpenSUSE. So, first thing is to edit the sudoers file:<\/p>\n<p><span style=\"font-family:courier new;\"> $ su -c visudo<\/span><\/p>\n<p>Then find these two lines and comment them out, and add the other line:<\/p>\n<p><span style=\"font-family:courier new;\"> #Defaults       targetpw<br \/>#ALL    ALL = (ALL) ALL<br \/>youruser ALL = (ALL) ALL<br \/><\/span><\/p>\n<p>This will enable your user called <span style=\"font-family:courier new;\">youruser<\/span> to run any program as the root user (actually any user), only needing his own password. You can of course make this more fine grained. You can allow this user only to run programs as a certain user, but that&#8217;s not the point here.<\/p>\n<p>What&#8217;s now still missing is to disable interactive logins or rather the su command. Edit the file <span style=\"font-family:courier new;\">\/etc\/shadow<\/span> and replace the root password with a <span style=\"font-family:courier new;\">*<\/span>:<\/p>\n<p><span style=\"font-family:courier new;\">root:*:13917::::::<\/span><\/p>\n<p>The encrypted password is always stored in the second field, delimited by the colons (&#8220;:&#8221;). One problem which I haven&#8217;t solved yet: I can run <span style=\"font-family:courier new;\">sudo \/sbin\/yast2<\/span> now, but that will only fire up the ncurses frontend of yast. I still need to find a way to run the Qt or gtk frontend. Well, this is for another post&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I updated my home machine, running OpenSUSE 11.1 at the moment (yeah, I know 11.2 is out, but I always wait a couple of months, for the first round of updates to settle in). I got used so much to OS X&#8217;s and Ubuntu&#8217;s style of not having an explicit root user, that I &hellip; <a href=\"https:\/\/www.root42.de\/blog\/?p=183\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;sudo vs su&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10],"tags":[],"_links":{"self":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/183"}],"collection":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=183"}],"version-history":[{"count":0,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/183\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}