{"id":2077,"date":"2025-09-13T22:37:41","date_gmt":"2025-09-14T05:37:41","guid":{"rendered":"https:\/\/catbradley.io\/?p=2077"},"modified":"2025-09-13T22:37:41","modified_gmt":"2025-09-14T05:37:41","slug":"sudo-vs-sudo-rs-what-you-need-to-know-about-the-rust-takeover-of-classic-sudo-command","status":"publish","type":"post","link":"https:\/\/catbradley.io\/?p=2077","title":{"rendered":"sudo vs sudo-rs: What You Need to Know About the Rust Takeover of Classic Sudo Command"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/itsfoss.com\/content\/images\/2025\/09\/sudo-rs.png\" alt=\"sudo vs sudo-rs: What You Need to Know About the Rust Takeover of Classic Sudo Command\" \/><\/p>\n<p>The upcoming <a href=\"https:\/\/www.youtube.com\/watch?v=gGNPiFaHTyA\">Ubuntu 25.10 release features<\/a> a controversial move to replace the classic sudo command with its Rust-based implementation, sudo-rs.<\/p>\n<p>This move could bring numerous questions for you. Like, why opt for this change? What&#8217;s wrong with the original? How would you use this new sudo? What happens to the old one?<\/p>\n<p>I will answer all these questions in this article.<\/p>\n<div class=\"kg-card kg-callout-card kg-callout-card-green\">\n<div class=\"kg-callout-emoji\">\ud83d\udcdd<\/div>\n<div class=\"kg-callout-text\"><b><strong>TLDR<\/strong><\/b>;<br \/>If you are a regular, end-user who uses sudo to run commands with root privileges, nothing changes for you at the surface, except for some error and warning messages. You&#8217;ll continue using sudo as you did before and it will automatically use Rust-based sudo underneath. However, if you are a sysadmin with custom sudo configuration, you should start paying attention as some features have been changed.<\/div>\n<\/div>\n<h2>What is sudo-rs?<\/h2>\n<p><a href=\"https:\/\/github.com\/trifectatechfoundation\/sudo-rs\">sudo-rs<\/a> is an implementation of the classic sudo and su written in the Rust programming language, which is known for its memory safety. The new sudo-rs is not 100% compatible with sudo as it drops some features and implements a few of its own. This new tool is under heavy development and may implement some of the missing sudo features.<\/p>\n<h2><strong>Why sudo-rs?<\/strong><\/h2>\n<p>Don&#8217;t fix what&#8217;s not broken, right? Perhaps not. <a href=\"https:\/\/www.youtube.com\/watch?v=6hXqal3BNYM\">Ubuntu developer discussion cited<\/a> these primary reasons for going with the Rust-based sudo:<\/p>\n<ul>\n<li><strong>Memory safety<\/strong>: <a href=\"https:\/\/blog.logrocket.com\/introducing-rust-borrow-checker\/\">Rust&#8217;s borrow checker<\/a> provides better memory management and prevents common security vulnerabilities.<\/li>\n<li><strong>Modern codebase<\/strong>: Easier to maintain and evolve compared to 30-year-old C code.<\/li>\n<li><strong>Better defaults<\/strong>: Removes outdated features that might now be considered security risks.<\/li>\n<li><strong>Younger contributor base<\/strong>: Young developers are opting for modern language like Rust instead of C. Rust&#8217;s safety features also make it easier for new developers to contribute more confidently.<\/li>\n<\/ul>\n<p>Basically, the 30-years old codebase of sudo is complicated and makes it difficult to patch or implement new features. Writing from scratch is easier and the use of a modern, memory-safe language will also help attract contributions from a borader pool of developers.<\/p>\n<p>Please note that the sudo-rs dev team is in touch with the original maintainer of the original sudo and they have found issues that were not only fixed in the new Rust-based sudo but also in the original sudo.<\/p>\n<p>So from what it seems, sudo-rs is the natural evolution over the classic sudo.<\/p>\n<h2>What changes between sudo and sudo-rs?<\/h2>\n<p>Not much for regular end user perspective. You&#8217;ll still be typing <code>sudo<\/code> as usual while it runs sudo-rs in the background. Some warning or error messages may have different text but that&#8217;s about it.<\/p>\n<p>For sysadmin and advanced users, there are a few things missing for now and some might not be implemented at all. For example, sudo-rs will not include the sendmail support of original sudo which was used for sending notifications about sudo usage.<\/p>\n<p><a href=\"https:\/\/lib.rs\/crates\/sudo-rs\">sudo-rs<\/a> always uses PAM for authentication and thus your system must be set up for PAM. sudo-rs will use the <code>sudo<\/code> and <code>sudo-i<\/code> service configuration. meaning that resource limits, umasks, etc have to be configured via PAM and not through the sudoers file.<\/p>\n<p>Wildcards are not supported in argument positions for a command to prevent common configuration mistakes in the sudoers file.<\/p>\n<h2>Using sudo or sudo-rs in Ubuntu<\/h2>\n<p>In Ubuntu 25.10, the command sudo is softlinked to sudo-rs. So, you&#8217;ll be using sudo as always but underneath, it will be running the new sudo-rs.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/itsfoss.com\/content\/images\/2025\/09\/sudo-rs-ubuntu.png\" class=\"kg-image\" alt=\"sudo vs sudo-rs: What You Need to Know About the Rust Takeover of Classic Sudo Command\" loading=\"lazy\" width=\"553\" height=\"124\" \/><\/figure>\n<p>The original sudo is still there in the system as <code>sudo-ws<\/code>. It resembles the official website <a href=\"https:\/\/www.sudo.ws\/\">sudo.ws<\/a> of the classic sudo project.<\/p>\n<p>If you want to use the OG sudo, you can just replace sudo with sudo-ws.<\/p>\n<p>As stated above, there are hardly any differences visible for regular users except for the slightly changed error and warning messages.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/itsfoss.com\/content\/images\/2025\/09\/sudo-vs-sudo-rs.png\" class=\"kg-image\" alt=\"sudo vs sudo-rs: What You Need to Know About the Rust Takeover of Classic Sudo Command\" loading=\"lazy\" width=\"561\" height=\"182\" \/><\/figure>\n<p>At least till Ubuntu 26.10, you can make the classic sudo the default sudo by updating the alternatives. Although I would advise against it. Unless you have a solid reason, there is no harm in using the Rust-based sudo. Clearly, this is what will be the future anyways.<\/p>\n<pre><code>sudo update-alternatives --config sudo<\/code><\/pre>\n<div class=\"kg-card kg-callout-card kg-callout-card-green\">\n<div class=\"kg-callout-emoji\">\ud83d\udca1<\/div>\n<div class=\"kg-callout-text\">sudo-rs is available in universe repository starting with Ubuntu 24.04. If you want to test it, you can type <code>sudo-rs<\/code> instead of <code>sudo<\/code> in your commands. Other distributions may also have this package available.<\/div>\n<\/div>\n<h2>sudo-rs is not the only alternative to sudo<\/h2>\n<p>Surprised? There are <a href=\"https:\/\/lwn.net\/Articles\/962588\/\">several alternatives to sudo<\/a> that have been in existence for some years now.<\/p>\n<p>There is this <a href=\"https:\/\/wiki.archlinux.org\/title\/Doas\">doas<\/a> command-line tool that can be considered a simplified, minimal version of sudo. <\/p>\n<p>Another Rust-based implementation of sudo like functionality is <a href=\"https:\/\/github.com\/LeChatP\/RootAsRole\">RootAsRole<\/a>.<\/p>\n<p>Some may even count <a href=\"https:\/\/man7.org\/linux\/man-pages\/man1\/uid0.1.html\">uid0 from systemd<\/a> as an alternative to sudo although it&#8217;s not in the same league in my opinion but serves a similar purpose.<\/p>\n<p>The official sudo website lists a <a href=\"https:\/\/www.sudo.ws\/docs\/alternatives\/\">few more alternatives<\/a>, but I think not all of them are seeing active development.<\/p>\n<h2>FAQ<\/h2>\n<p>Let&#8217;s summarize and answer some of your frequently asked questions on sudo-rs inclusion.<\/p>\n<h3>What is sudo-rs?<\/h3>\n<p>sudo-rs is re-implementation of the classic C based sudo but written in memory-safe Rust programming language. <\/p>\n<h3>Do I have to use sudo-rs command instead of sudo?<\/h3>\n<p>No. Starting with Ubuntu 25.10, sudo is softlinked to sudo-rs. Which means that while you continue using sudo as you did in previous versions, it will automatically be running sudo-rs underneath.<\/p>\n<h3>Can I remove sudo-rs and go back to original sudo?<\/h3>\n<p>Yes. The original sudo is available as sudo.ws command and you can use <code>update-alternatives<\/code> to go set it the default sudo. But it is only possible until Ubuntu 26.04. Canonical plans to test sudo-rs as the only sudo mechanism in 26.10.<\/p>\n<h3>What changes between sudo and sudo-rs?<\/h3>\n<p>Nothing for common end-users. However, advanced, sysadmin oriented features like sendmail, wildcard support in sudoer file etc., have been changed. Sysadmins should read the man page of sudo-rs for more details.<\/p>\n<h2>Conclusion<\/h2>\n<p>To me, you don&#8217;t have much to worry about if you are a regular user who never touched the sudo config file. Managing servers with custom sudo config? You should pay attention. <\/p>\n<p>Now, was it a wise decision to replace a (prefectly?) working piece of software and replace it with Rust? Is it another example of &#8216;let&#8217;s do it in Rust&#8217; phenomena sweeping the dev world? Share your opinion in the comments.<\/p>","protected":false},"excerpt":{"rendered":"<p>The upcoming Ubuntu 25.10 release features a controversial move to replace the classic sudo command with its Rust-based implementation, sudo-rs. This move could bring numerous questions for you. Like, why&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2077","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-rss"],"_links":{"self":[{"href":"https:\/\/catbradley.io\/index.php?rest_route=\/wp\/v2\/posts\/2077","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/catbradley.io\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/catbradley.io\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/catbradley.io\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/catbradley.io\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2077"}],"version-history":[{"count":0,"href":"https:\/\/catbradley.io\/index.php?rest_route=\/wp\/v2\/posts\/2077\/revisions"}],"wp:attachment":[{"href":"https:\/\/catbradley.io\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2077"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/catbradley.io\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2077"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/catbradley.io\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2077"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}