LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 05-18-2019, 12:11 PM   #1
hemlocktree
Member
 
Registered: Aug 2018
Posts: 719

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
su in debian vs su in debian based os's


ok serious yet dumb question. been using ubuntu based os's. ubuntu is based on debian. so why - in ubuntu=based stuff sudo is used? and in debian su is used. i was told by one guy you can set it up for su but on their forum (debian users forum) when i asked this about using su and not sudo because i couldn't get something to work until i was told use su.... and then you use commands without su in front of them and also i figured out after some search that you have to exit at the end too or terminal is still open/in use/running. anyway - getting back to the people on the debian forum - 1 was nice and told me there is an option for sudo that you have to do through some commands or some such but all the others were so nasty and arrogant and said sudo is no good and no need and use su - that is the only way and many said go search on your own.... so why? what is better about one than another is there is? and why the 2 different ways and uses? not very eloquent but you may see where i am going with this. thanks
 
Old 05-18-2019, 12:33 PM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,630

Rep: Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265
su and sudo are two different tools. See man pages:
Code:
The su command is used to become another user during a login session.
sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy.
both of them are often misused (not to speak about the completely meaningless mixture of them: sudo su - using both of them in the same time).
 
Old 05-18-2019, 02:18 PM   #3
hemlocktree
Member
 
Registered: Aug 2018
Posts: 719

Original Poster
Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
thanks but still a bit lost
 
Old 05-18-2019, 02:40 PM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,630

Rep: Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265
if you want to understand, there is a youtube video: "Sudo: You're Doing it Wrong"
 
Old 05-18-2019, 03:00 PM   #5
Tonus
Senior Member
 
Registered: Jan 2007
Location: Paris, France
Distribution: Slackware-15.0
Posts: 1,394
Blog Entries: 3

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
su in debian vs su in debian based os's

Sudo has to be configured and permitt to avoid typing the password or to type the user's password to run root commands.

I prefer the
Code:
 su -c 'my command as root'
way. Even, or especially because, it needs the root password.
 
Old 05-18-2019, 03:02 PM   #6
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Also, see here: https://www.howtogeek.com/111479/htg...tween-sudo-su/

The debate over su vs. sudo is one of the most significant ones in the Linux world (search the web for much of the debate), up there with systemd, pulseaudio etc., with both sides strongly arguing their case. In the end, you're probably best to accept that Ubuntu and non-Ubuntu distros (in general) do this differently, and just go with the flow.
 
Old 05-18-2019, 04:26 PM   #7
hemlocktree
Member
 
Registered: Aug 2018
Posts: 719

Original Poster
Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
ok thanks - i will check it out tomorrow when we have storms - been a long day woke at 3:30 and out in the vineyard and garden and cut grass all day.

hydrurga - i know and i agree and i will just go with the flow - have no chaice other than to set deb to use sudo but i was curious - i am ok with doing both---- just really trying to understand it from my lower level. i see these arguments all over the forums and not opening a can of worms - just seem rather weird or strange that there isn't a common denominator as such other than being based on debian. know what i mean???

:-)))))
 
Old 05-18-2019, 04:30 PM   #8
ChuangTzu
Senior Member
 
Registered: May 2015
Location: Where ever needed
Distribution: Slackware/Salix while testing others
Posts: 1,718

Rep: Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857
sudo allows logging of commands/executions and you can restrict the power granted to the sudo user, su makes you God of the computer and that lightning can create and destroy, its up to you. Personally I prefer to use su -c "command" which requires me to enter the root password and then after completing the task returns to regular user, thus I avoid leaving the su - terminal open...funny how I still forget that its open after all these years. With su -c "command", no worries about that.
 
Old 05-18-2019, 04:55 PM   #9
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by hemlocktree View Post
ok thanks - i will check it out tomorrow when we have storms - been a long day woke at 3:30 and out in the vineyard and garden and cut grass all day.

hydrurga - i know and i agree and i will just go with the flow - have no chaice other than to set deb to use sudo but i was curious - i am ok with doing both---- just really trying to understand it from my lower level. i see these arguments all over the forums and not opening a can of worms - just seem rather weird or strange that there isn't a common denominator as such other than being based on debian. know what i mean???

:-)))))
Indeed. Sudo has been here with su for a long while though, with both being used. It was Ubuntu who decided to lock the root password and make their systems sudo only by default for security reasons (essentially to protect users from themselves), although it is reasonably easy to get round this and create a root password if you are so inclined. However, this jarred with some who felt that sudo was not being used for the purposes for which it was intended. Thus began the su-sudo wars.

From the point of view of Ubuntu:

https://help.ubuntu.com/community/RootSudo
 
Old 05-18-2019, 05:00 PM   #10
ChuangTzu
Senior Member
 
Registered: May 2015
Location: Where ever needed
Distribution: Slackware/Salix while testing others
Posts: 1,718

Rep: Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857
Decent article about sudo: https://community.centrify.com/s/art...o-Part-1-22282
 
Old 05-18-2019, 05:17 PM   #11
hemlocktree
Member
 
Registered: Aug 2018
Posts: 719

Original Poster
Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
thanks again - need another 64 oz of coffee tomorrow am to check this all out. so there is a security element and i did know that su was the top level access i guess you might say. give me some time tomorrow to check out all the info... thanks again
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorce based distro (gentoo) Vs Binary based distro(fedora, debian,..) ashwin_cse Linux - Distributions 7 02-08-2010 01:46 PM
pci based usb hc based on necd72010xf1 and pinnacle pctv card bt878 based ashwani_gupt Linux - Hardware 0 12-17-2009 08:34 AM
What does Debian-based or Slackware-based mean?? QueenZ Linux - Newbie 67 02-22-2009 12:55 AM
LXer: Using Xen With LVM-Based VMs Instead Of Image-Based VMs (Debian Etch) LXer Syndicated Linux News 0 01-14-2009 08:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 01:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration