LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-17-2014, 02:34 AM   #1
nkd
Member
 
Registered: Oct 2006
Location: india
Distribution: fedora 8, ubuntu 10.10
Posts: 315

Rep: Reputation: 34
what does sudo -s do?


hi,
I am trying to figure out what does the following command do :-
Quote:
sudo -s
As per the documentation it :-
Quote:
The ‑s (shell) option runs the shell specified by the SHELL environment variable if it is set or the shell as specified in the password database.
But on the system it drops me to root prompt :-
Quote:
john@home:~$ sudo -s
root@home:~#
This doesnot seem right ! Also, without any more passwords I may do anything on the system.

Can someone Plz clarify, what sudo -s does ?
nishith
 
Old 08-17-2014, 02:43 AM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 4,506
Blog Entries: 6

Rep: Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421
Quote:
Originally Posted by nkd View Post
hi,
I am trying to figure out what does the following command do :-

As per the documentation it :-

But on the system it drops me to root prompt :-

This doesnot seem right ! Also, without any more passwords I may do anything on the system.

Can someone Plz clarify, what sudo -s does ?
nishith
Well, as per the documentation it :-

Quote:
The ‑s (shell) option runs the shell specified by the SHELL environment variable if it is set or the shell as specified in the password database.
Which is exactly what it says it will do, i.e. open a shell with root permissions...

What did you think that meant?

Last edited by astrogeek; 08-17-2014 at 02:46 AM.
 
1 members found this post helpful.
Old 08-17-2014, 05:20 AM   #3
glennT
LQ Newbie
 
Registered: Jun 2012
Location: texas
Distribution: fedora (redhat, slackware, suse in the past)
Posts: 2

Rep: Reputation: Disabled
One of the things "sudo -s" does is to check what privileges the user has. On your system john has privileges beyond the normal user. (Create another user and that user won't get a root prompt via "sudo -s".)

sudo is a way for root to give mere mortal users some extra power; there must be a way to control who has what power. "man sudo" and be sure to check out the 'SEE ALSO' section (eg "man sudoers").

gt
 
  


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
sudo: effective uid is not 0, is sudo installed setuid root? awladnas Linux - Newbie 10 08-30-2014 07:03 PM
Question about the sudo command, specifically how to have sudo act as if user is root slacker_ Linux - Newbie 17 09-22-2013 04:48 PM
LXer: The Ultimate Sudo FAQ To Sudo Or Not To Sudo? LXer Syndicated Linux News 13 04-13-2013 02:36 AM
Unable to redirect all sudo messages to /var/log/sudo driftwood Linux - Server 2 10-18-2012 05:34 AM
Restricting Editing in Sudo (Advanced Sudo Question) LinuxGeek Linux - Software 4 11-04-2006 04:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:20 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration