apt-get confussion

Matthew1974

New Member
Joined
May 2, 2019
Messages
5
Reaction score
3
Credits
15
My Linux machine has two users root and matthew, I keep the passwords written in a text file so that I know I'm not making a spelling mistake (maybe a security issue, but that's not related to my question).

I was logged in as matthew and I wanted to install nano, so I typed.
sudo apt-get install nano

This didn't work. I tried it several times double checking that all the passwords were correct and being confused.

I logged in as root and typed.
apt-get install nano

This worked first time, I've even openned nano as root as well as openning nano whilst being logged in as matthew, so nano is most definitely installed.

Can anyone explain why the installation didn't work for the log in matthew using sudo?
 


OP
M

Matthew1974

New Member
Joined
May 2, 2019
Messages
5
Reaction score
3
Credits
15

Rob

Administrator
Staff member
Joined
Oct 27, 2011
Messages
1,181
Reaction score
2,172
Credits
3,302
@Matthew1974 - welcome to the forum!

sudo can get very granular, for instance you can add a user to sudoers and allow him to do anything, or limit them to just one (or a few commands).


Here's a short video that may help you out..
 

TechnoJunky

Well-Known Member
Joined
Dec 3, 2018
Messages
501
Reaction score
399
Credits
398
Everyone should not be able to run sudo, only people who you want to have root privileges. You should never log in as root, unless absolutely necessary as you can make mistakes that screw the system up totally. So put matthew in the sudoers file and when you need to install something sudo will work.
 
  • Like
Reactions: Rob

Staff online

Members online


Latest posts

Top