Wheezy: adding myself to the sudo group using usermod

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

Wheezy: adding myself to the sudo group using usermod

rhkramer

(On Wheezy) I've been trying to add myself to the sudo group with the usermod command.

 

As root, I've tried most of the permutations of this:

 

usermod -a -G sudo <username>

 

None of them have worked -- any suggestions?

 

(I have checked using groups (as username), and even have opened fresh terminals. Hmm, maybe I have to reboot? I hope not, I don't want to do that in the near future.)

Reply | Threaded
Open this post in threaded view
|

Re: Wheezy: adding myself to the sudo group using usermod

Brian
On Thu 04 Apr 2019 at 12:54:52 -0400, [hidden email] wrote:

> (On Wheezy) I've been trying to add myself to the sudo group with the usermod
> command.

vigr is your friend.

--
Brian.

Reply | Threaded
Open this post in threaded view
|

Re: Wheezy: adding myself to the sudo group using usermod

Thomas Pircher-2
Brian wrote:
> On Thu 04 Apr 2019 at 12:54:52 -0400, [hidden email] wrote:
>
> > (On Wheezy) I've been trying to add myself to the sudo group with the usermod
> > command.
>
> vigr is your friend.

I don't think this will fix OP's problem.

rhkramer, you don't need to reboot your machine, but you need to
re-login in order to start a session with your new set of groups.

If you do 'su $USER' on the terminal then this should start a session
with the new groups _in this session only_.

If you need the change globally (e.g. for applications you start from
the GUI) then you will have to logout and login again.

Thomas

Reply | Threaded
Open this post in threaded view
|

Re: Wheezy: adding myself to the sudo group using usermod

Reco
In reply to this post by rhkramer
        Hi.

On Thu, Apr 04, 2019 at 12:54:52PM -0400, [hidden email] wrote:
> (On Wheezy) I've been trying to add myself to the sudo group with the usermod
> command.
>
> As root, I've tried most of the permutations of this:
>
> usermod -a -G sudo <username>
>
> None of them have worked -- any suggestions?

adduser <username> sudo

It's Debian-specific, but saves one the confusion.
Don't forget to relogin after adduser.

Reco

Reply | Threaded
Open this post in threaded view
|

Re: Wheezy: adding myself to the sudo group using usermod

Roberto C. Sánchez-2
In reply to this post by Thomas Pircher-2
On Thu, Apr 04, 2019 at 06:42:19PM +0100, Thomas Pircher wrote:

> Brian wrote:
> > On Thu 04 Apr 2019 at 12:54:52 -0400, [hidden email] wrote:
> >
> > > (On Wheezy) I've been trying to add myself to the sudo group with the usermod
> > > command.
> >
> > vigr is your friend.
>
> I don't think this will fix OP's problem.
>
> rhkramer, you don't need to reboot your machine, but you need to
> re-login in order to start a session with your new set of groups.
>
> If you do 'su $USER' on the terminal then this should start a session
> with the new groups _in this session only_.
>
'newgrp' is a bit nicer than 'su $USER', being that the latter can
change your environment (depending on system settings).

> If you need the change globally (e.g. for applications you start from
> the GUI) then you will have to logout and login again.
>
There is no way around this for a global update.

Regards,

-Roberto

--
Roberto C. Sánchez

Reply | Threaded
Open this post in threaded view
|

Re: Wheezy: adding myself to the sudo group using usermod

Cindy Sue Causey
In reply to this post by rhkramer
On 4/4/19, [hidden email] <[hidden email]> wrote:

> (On Wheezy) I've been trying to add myself to the sudo group with the
> usermod
> command.
>
> As root, I've tried most of the permutations of this:
>
> usermod -a -G sudo <username>
>
> None of them have worked -- any suggestions?
>
> (I have checked using groups (as username), and even have opened fresh
> terminals.  Hmm, maybe I have to reboot?  I hope not, I don't want to do
> that
> in the near future.)


Hi.. It took about 5 times of reading what you wrote before I
remembered that I don't have to "reboot", but I do have to *logout*
for changes like that to take hold. The DIFFERENCE is that I use
"adduser" to make those kinds of changes:

And, yes, I know... logging out might as well be rebooting depending
on what kind of work we have opened across our desktops. :)

K/t having learned of adduser while debootstrap'ing, I use:

adduser <username> sudo

If you go looking for adduser and don't find it for Wheezy, see if
useradd is there for you. Possibly maybe even installed already?

*My understanding* is that adduser and useradd do similar things.
Chatter on the Net over time *seems* to be saying that adduser maybe
[embellishes] a little...

Or something like that.

PS I'm not finding either usermod OR useradd via a quick "apt-cache
search" of Debian _Buster_ "main" repository. Seems like I remember
seeing chatter about that, too, along the way.

Cindy :)
--
Cindy-Sue Causey
Talking Rock, Pickens County, Georgia, USA

* runs with birdseed *

Reply | Threaded
Open this post in threaded view
|

Re: Wheezy: adding myself to the sudo group using usermod

Cindy Sue Causey
SORRY :)

On 4/4/19, Cindy Sue Causey <[hidden email]> wrote:

> On 4/4/19, [hidden email] <[hidden email]> wrote:
>> (On Wheezy) I've been trying to add myself to the sudo group with the
>> usermod
>> command.
>>
>> As root, I've tried most of the permutations of this:
>>
>> usermod -a -G sudo <username>
>>
>> None of them have worked -- any suggestions?
>>
>> (I have checked using groups (as username), and even have opened fresh
>> terminals.  Hmm, maybe I have to reboot?  I hope not, I don't want to do
>> that
>> in the near future.)
>
>
> Hi.. It took about 5 times of reading what you wrote before I
> remembered that I don't have to "reboot", but I do have to *logout*
> for changes like that to take hold. The DIFFERENCE is that I use
> "adduser" to make those kinds of changes:
>
> And, yes, I know... logging out might as well be rebooting depending
> on what kind of work we have opened across our desktops. :)
>
> K/t having learned of adduser while debootstrap'ing, I use:
>
> adduser <username> sudo
>
> If you go looking for adduser and don't find it for Wheezy, see if
> useradd is there for you. Possibly maybe even installed already?
>
> *My understanding* is that adduser and useradd do similar things.
> Chatter on the Net over time *seems* to be saying that adduser maybe
> [embellishes] a little...
>
> Or something like that.
>
> PS I'm not finding either usermod OR useradd via a quick "apt-cache
> search" of Debian _Buster_ "main" repository. Seems like I remember
> seeing chatter about that, too, along the way.


*NEVER MIND*

As soon as I hit send, I thought to double-tab on "user" while in "su
-". Useradd's there. Userdel... Usermod............

Just not having the best of cognitive days today... :)

Cindy :)
--
Cindy-Sue Causey
Talking Rock, Pickens County, Georgia, USA

* runs with birdseed *

Reply | Threaded
Open this post in threaded view
|

Re: Wheezy: adding myself to the sudo group using usermod

Brian
In reply to this post by Thomas Pircher-2
On Thu 04 Apr 2019 at 18:42:19 +0100, Thomas Pircher wrote:

> Brian wrote:
> > On Thu 04 Apr 2019 at 12:54:52 -0400, [hidden email] wrote:
> >
> > > (On Wheezy) I've been trying to add myself to the sudo group with the usermod
> > > command.
> >
> > vigr is your friend.
>
> I don't think this will fix OP's problem.

Really? vigr cannot be used to add a user to a group? From the manual:

 > vipw, vigr - edit the password, group, shadow-password
 > or shadow-group file
>
> rhkramer, you don't need to reboot your machine, but you need to
> re-login in order to start a session with your new set of groups.

rhkramer is an experienced user; he knows logging out and logging in
again is necessary.

Reply | Threaded
Open this post in threaded view
|

Re: Wheezy: adding myself to the sudo group using usermod

Thomas Pircher-2
Brian wrote:
>
> Really? vigr cannot be used to add a user to a group?

Nobody has stated that.

Since the OP had the correct command in his  email, I assumed that the
operation worked, but hasn't been activated in the current session.

Do I know that for sure? No, he hasn't said exactly what doesn't work,
but from the rest of his mail I think that is a fair guess.

> rhkramer is an experienced user; he knows logging out and logging in
> again is necessary.

And that's an assumption on your part. :-)

Thomas

Reply | Threaded
Open this post in threaded view
|

Re: Wheezy: adding myself to the sudo group using usermod

Brian
On Thu 04 Apr 2019 at 19:38:01 +0100, Thomas Pircher wrote:

> Brian wrote:
> >
> > Really? vigr cannot be used to add a user to a group?
>
> Nobody has stated that.
>
> Since the OP had the correct command in his  email, I assumed that the
> operation worked, but hasn't been activated in the current session.

That's an assumption on your part. :) But making it is not unreasonable.

> Do I know that for sure? No, he hasn't said exactly what doesn't work,
> but from the rest of his mail I think that is a fair guess.
>
> > rhkramer is an experienced user; he knows logging out and logging in
> > again is necessary.
>
> And that's an assumption on your part. :-)

Which bit is an assumption? Experienced? I hope you are not questioning
his competence.

--
Brian.

Reply | Threaded
Open this post in threaded view
|

Re: Wheezy: adding myself to the sudo group using usermod

Thomas Pircher-2
Brian wrote:
> Which bit is an assumption? Experienced? I hope you are not questioning
> his competence.

No, definitely not, I have been reading this list for some time and have
absolutely no reason to doubt his experience or competence. I wish I had
stated that better.

What I meant was that he might not know (or might have forgotten) that
some changes to a system user are not immediately visible in active
sessions.
To my mind this is one of the more obscure features of the system one
has to learn the hard way because it is not intuitive or obvious.

Thomas

Reply | Threaded
Open this post in threaded view
|

Re: Wheezy: adding myself to the sudo group using usermod

Brian
On Thu 04 Apr 2019 at 20:10:16 +0100, Thomas Pircher wrote:

> Brian wrote:
> > Which bit is an assumption? Experienced? I hope you are not questioning
> > his competence.
>
> No, definitely not, I have been reading this list for some time and have
> absolutely no reason to doubt his experience or competence. I wish I had
> stated that better.
>
> What I meant was that he might not know (or might have forgotten) that
> some changes to a system user are not immediately visible in active
> sessions.
> To my mind this is one of the more obscure features of the system one
> has to learn the hard way because it is not intuitive or obvious.

Well said.

--
Brian.

Reply | Threaded
Open this post in threaded view
|

Re: Wheezy: adding myself to the sudo group using usermod

rhkramer
Thanks to all who replied, and thanks for the flattering comments ;-)

The key for me was needing to do something like logging out and back in -- I
haven't added myself to groups very often (if ever) (or manually created a
user), and I just didn't think about something like that.

I like to think of myself as competent and experienced, but, with experience
(and competence) comes age, and things like forgetfulness.

(I may ask another question in a few minutes which may make everyone question
my competence ;-)

On Thursday, April 04, 2019 04:33:54 PM Brian wrote:

> On Thu 04 Apr 2019 at 20:10:16 +0100, Thomas Pircher wrote:
> > Brian wrote:
> > > Which bit is an assumption? Experienced? I hope you are not questioning
> > > his competence.
> >
> > No, definitely not, I have been reading this list for some time and have
> > absolutely no reason to doubt his experience or competence. I wish I had
> > stated that better.
> >
> > What I meant was that he might not know (or might have forgotten) that
> > some changes to a system user are not immediately visible in active
> > sessions.
> > To my mind this is one of the more obscure features of the system one
> > has to learn the hard way because it is not intuitive or obvious.
>
> Well said.

Reply | Threaded
Open this post in threaded view
|

Re: Wheezy: adding myself to the sudo group using usermod

Curt
On 2019-04-04, [hidden email] <[hidden email]> wrote:
>
> (I may ask another question in a few minutes which may make everyone question
> my competence ;-)

Well, you top-posted so we're taking off two points on your competency
report anyway.

;-)


Reply | Threaded
Open this post in threaded view
|

Re: Wheezy: adding myself to the sudo group using usermod

rhkramer
On Friday, April 05, 2019 03:39:34 AM Curt wrote:
> On 2019-04-04, [hidden email] <[hidden email]> wrote:
> > (I may ask another question in a few minutes which may make everyone
> > question my competence ;-)
>
> Well, you top-posted so we're taking off two points on your competency
> report anyway.
>
> ;-)

+1 ;-)

Reply | Threaded
Open this post in threaded view
|

Re: Wheezy: adding myself to the sudo group using usermod

rhkramer
In reply to this post by rhkramer
On Thursday, April 04, 2019 05:23:33 PM [hidden email] wrote:
> Thanks to all who replied, and thanks for the flattering comments ;-)

                                                    ^^^^^^^^^^^^^^^^^^^^^^
I should have said "thanks for the vote of confidence".