Updates:

Many new features now available including 2-Factor authentication

Sudo Prefix

Started by Jocklad 1, November 28, 2014, 08:53:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jocklad 1


Just a query...

For example: If you run apt-get update in terminal it asks if you are root.

Which means to me it needs a Sudo prefix to carry out the command.

Or am I missing something here...?.

Jocklad  ::) ::)

galaxytdm

You're right, but why the confusion?
If you need help ask a professional, then act upon their advice.
Anything less and you're just wasting peoples time.


BkS

From experience apt-get update has needed elevated privileges to make system changes which is why you need to call sudo or su.
If you try to look through Windows, you can see what the person is doing.
If you try to look through a Penguin, it WILL bite you.

Jocklad 1

Quote from: BkS on November 28, 2014, 09:00:07 PM
From experience apt-get update has needed elevated privileges to make system changes which is why you need to call sudo or su.

Thats the point I was trying to make.

The apt-get update command on its own is useless.

Jocklad

Mark Greaves (PCNetSpec)

#4
Yeah, but why are you making the point?

[EDIT]

If you're referencing my earlier posting where the user is working in kali linux and I told him to run "apt-get update" .. he's already at a root prompt ("#" as oposed to "$") so already has elevated privileges and therefore doesn't require "sudo" (indeed the "sudo" command may not even be installed in kali).
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk


Jocklad 1

#5
Quote from: Mark Greaves (PCNetSpec) on November 28, 2014, 09:14:07 PM
Yeah, but why are you making the point?

Trying to learn linux mark.

Rarely a day passes I dont learn something new about Linux.

Which is why I love my Linux.

But commands like this can only lead to confusion for people new to Linux.

Quote: PC Net Spec If you're referencing my earlier posting where the user is working in kali linux and I told him to run "apt-get update" .. he's already at a root prompt ("#" as oposed to "$") so already has elevated privileges and therefore doesn't require "sudo" (indeed the "sudo" command may not even be installed in kali).
« Last Edit: Today at 09:18:25 pm by Mark Greaves (PCNetSpec) »

Thanks Mark I seen your post.

But the purpose of the thread was a Discussion on the Sudo prefix.

Jocklad  :)


Jocklad  :)

Mark Greaves (PCNetSpec)

Quote from: Jocklad 1 on November 28, 2014, 09:20:14 PMcommands like this can only lead to confusion for people new to Linux.

Commands like these lead to security .. and it's a fairly simple concept, if the command id going to modify anything outside your home folder it will need elevated privileges with sudo

so
apt-get download gedit
will work as long as the current directory is in your home folder .. as it only downloads the gedit.deb package to the current dikrectory

but
apt-get install gedit
won't, as it needs to install the package system wide .. so would place files in various locations such as /usr/bin/gedit which you  need elevated permission to write to.

apt-get update
updates the package caches system wide at /var/lib/apt/lists .. again you need elevated privileges to write there as it's not in your home folder.
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Jocklad 1


That makes things a lot clearer.

Thanks Mark  :) :) :)

Mark Greaves (PCNetSpec)

#8
I forgot to add that prefixing a command with "sudo" will force it to prompt for your password and only allow you to elevate privileges if you are a member of the sudo group and you provide the correct password.

it's all about security :)

Where in Windows, you or any process can modify pretty much any important system files .. in Linux you (or a process) CANNOT without first being given permission by someone in the sudo group.

By making certain user accounts NOT part of the sudo group, the system administrator can effectively make sure those users can't make any system wide changes that could harm the OS or install anything .. they can only damage their own home folder.
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk


Jocklad 1


Thanks Mark for your explanation on Sudo.

Makes much more sense to me now.

Jocklad  :) :)

banko

If you Do anything as Super User (root)

Its Super User Do :- sudo