{"id":515,"date":"2012-04-30T10:37:35","date_gmt":"2012-04-30T14:37:35","guid":{"rendered":"http:\/\/blog.alanporter.com\/?p=515"},"modified":"2012-04-30T10:37:35","modified_gmt":"2012-04-30T14:37:35","slug":"sudo-vs-root-password","status":"publish","type":"post","link":"https:\/\/alanporter.com\/blog\/2012\/04\/30\/sudo-vs-root-password\/","title":{"rendered":"&#8216;sudo&#8217; vs using a root password"},"content":{"rendered":"<p>There seems to be a lot of confusion about the use of &#8220;sudo&#8221; vs using a root password.\u00a0 It&#8217;s a lot simpler than many make it out to be.<\/p>\n<ul>\n<li>On a system that uses a root password, all administrators use a shared root password.<\/li>\n<li>On a system that uses &#8220;sudo&#8221;, all administrators use their own passwords.<\/li>\n<li>There is no reason why you can&#8217;t do both.<\/li>\n<\/ul>\n<p>Some people argue about a Linux distribution&#8217;s\u00a0<strong>default<\/strong> setting, when they could simply change the setting after installation and forget about it.<\/p>\n<ul>\n<li>To enable a root password:<br \/>\n<code>$ sudo passwd root<\/code><\/li>\n<li>To disable a root password:<br \/>\n<code>$ sudo passwd -l root<\/code><\/li>\n<li>To start using sudo:<br \/>\n<code># apt-get install sudo<br \/>\n# adduser username sudo<\/code><\/li>\n<li>To stop using sudo:<br \/>\n<code># gpasswd -d username sudo<br \/>\n# apt-get remove --purge sudo<\/code> (optional)<\/li>\n<li>To run a &#8220;su-like&#8221; shell using &#8220;sudo&#8221;:<br \/>\n<code>$ sudo -s<\/code> (runs a normal shell)<br \/>\nor<br \/>\n<code>$ sudo -i<\/code> (runs a login shell)<\/li>\n<\/ul>\n<p>Personally, I have gotten used to disabling my root password and the using either <code>sudo -i<\/code> or <code>ssh root@hostname<\/code>.\u00a0 That&#8217;s one less password for me to remember, and one less password that can be probed on the network.<\/p>\n<p>But you don&#8217;t have to be like me&#8230; you do what feels right to you!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There seems to be a lot of confusion about the use of &#8220;sudo&#8221; vs using a root password.\u00a0 It&#8217;s a lot simpler than many make it out to be. On a system that uses a root password, all administrators use a shared root password. On a system that uses &#8220;sudo&#8221;, all administrators use their own [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,15],"tags":[],"class_list":["post-515","post","type-post","status-publish","format-standard","hentry","category-software","category-tips-tricks","count-0","even alt","author-alan","last"],"_links":{"self":[{"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/posts\/515","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/comments?post=515"}],"version-history":[{"count":0,"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/posts\/515\/revisions"}],"wp:attachment":[{"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/media?parent=515"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/categories?post=515"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/tags?post=515"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}