- 5paisa
- AdSense
- Android
- Asphalt 8 : Airborne Mod Apk 4.9.1b Unlimited Money
- Battlegrounds Mobile India
- Blogger
- Blogging
- Bug Hunting
- cloud storage
- Cmd
- Damn vulnerable Web Application
- Demat Account
- Difference between
- dj alok
- dj alok in free firefree
- Doodle Army 2 : Mini Militia 5.2.0 Apk + Mod for android
- DVMA
- E-books
- earn Bitcoins
- Ethical hacking tutorials
- Express vpn
- EXPRESSVPN PRO APK 7.12.1
- EXPRESVPN CRACKED APK
- fire dj alok
- Freefire
- Gaming
- Google drive
- Google llc
- gplink
- Groww App
- Health
- helo
- helo mela
- helo app
- Helo app earn paytm
- Helo app full guide
- Helo app invite and earn
- Helo app redeem proof
- Helo app refer and earn
- Helo app unlimited trick
- Helo app withdraw proof
- Helo Mela Offer: Get Rs.2 Free Paytm Cash + Win Upto Rs.10000 Paytm Cash
- helo refer and earn
- How to
- How to combine two Wifi Connections to get a faster Internet
- how to get dj alok for free
- how to get free dj alok
- how to get free dj alok in free fire
- How to install DVWA on Kali Linux 2020.2
- How To Use Light Speed WebCache on Your website
- ICICI Direct
- IOS
- kali linux
- Live streaming
- makeup
- meesho
- Money Earning
- My poems
- Netflix
- Netflix mod
- Netflix premium
- News
- online courses
- Pentesting
- programming
- PUBG
- Puffin Browser Pro 8.3.0.41446 (Full) Apk + Mod for Android
- Puzzles
- Recharge offers
- Refer and Earn
- Reviews
- SEO
- shell Scripting
- Shortlink
- Spotify Music 8.5.57.1164 APK Mega Mod Cracked Latest Android
- stylish name
- Technology
- Tips&Tricks
- Township Mod Apk 7.5.0 Unlimited Money
- Udemy
- Udemy courses
- Udemy free
- Udemy premium
- VClip app download link
- VClip app full details
- VClip app invitation link
- VClip app referral code
- VClip app referral link
- VClip app review
- Web designing
- What is
- WINDOWS
- Wishes
- Wordpress
- World Cricket Championship 2 2.8.9 Apk + Mod (Coins/Unlocked)
- Youtube tricks
- zoom app
- zoom bombing
- zoom call
- Zoom safety tips
What Is The Difference Between Sudo And Su In Linux ?
What Is The Difference Between Sudo And Su In Linux ?
Short : Many of you might be using sudo and su in terminal every day to accomplish different tasks. While sudo runs a single command with root privileges, su launches another shell instance with the privileges of the intended user. Both, sudo and su, are use to grant root privileges to the users in different manners.
A Linux user comes across sudo and su in terminal very often. If you are a new Linux user, you might be fascinated by the things you can do with sudo and su. Last week, I also told you about a Windows command that you can use to get sudo-like functionality. Sudo and su provide root privileges in two different ways. But, how are they different? Here, I’ll try to answer this query.
Before telling you the difference, let me tell you the meaning of a root user. The root user in a Linux system has the maximum permissions and he/she can do anything to the systems. Apart from letting a normal user install/delete some package, root user permissions also act as an extra security layer.
Important : One should also note that these functions are used in a different way in different Linux-based operating systems. Most of the things we’ll discuss here are applicable to Ubuntu and its derivatives. They might differ a little bit in other Linux distributions.
Key differences between sudo and su
The su command stands for super user or root user. It executes on a Linux system with no additional options. The user just needs to add root account password. In the terminal, su also lets you access any other user account using the required password. That’s why su also stands for substitute user or switch user. Simply type su followed by the user account name, e.g., sudo fossbytes, and you’ll enter the password for fossbytes. After completing the job, you can exit the root shell by typing exit. Overall, su basically starts another shell instance with the privileges of the intended user.
On the other hand, sudo runs a single command with root permissions. When a user runs a command with sudo, e.g., sudo command, he/she needs to enter the current user account password to run it as root user. Sudo uses a config file (/etc/sudoers) to define the rights of different users. For detailed information on sudo, you can read our detailed article written by Devin — Sudo in Linux
Comparing the both, sudo lets one use the user account password to run system command. On the other hand, su forces one to share the root passwords to other users. Also, sudo doesn’t activate the root shell and runs a single command.
Using sudo and su in Linux distros
Ubuntu was the first widely used Linux distribution that adopted sudo-only approach by default. When one installs Ubuntu Linux, the root account is created without any password. One needs to assign a password to the root account to log in as root. In Ubuntu and many other Debian-based distros, the user needs to remember just a single password. This way, Ubuntu encourages a user to avoid logging in as a root user. In distros like Fedora, a person needs to create different passwords for root and user accounts.
There’s an often-used combination sudo su that Linux users find helpful. First, sudo asks for your password, and, if it’s provided, it runs the next command as a root user. Also, to run a single command as a root user using su, one needs to use this syntax: su -c ‘command’.
Did you find this article helpful? Don’t forget to drop your feedback in the comments section below.
Also Read
KUMAR JEERU
. I am a Programmer and Pentester. I find and Fix loophole in websites and networks. Connect with me for queries , web developemnt , Scanning and Fixing website Security issues. My company gives special discount for independent entrepreneur , small and Medium size companies. Contact me directly on my face page
Post a Comment
Post a Comment