LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 09-25-2016, 06:15 AM   #1
sigint-ninja
Member
 
Registered: Feb 2011
Location: Republic Of Ireland
Distribution: Debian,Centos,Slackware
Posts: 485

Rep: Reputation: 29
newgrp root asks for password i dont have


if i wanted to add group root as my primary group (this is prob bad practice im guessing)

and i use:
newgrp root

it asks me for a password

nor mine or root work...why is this?
 
Old 09-25-2016, 06:25 AM   #2
sigint-ninja
Member
 
Registered: Feb 2011
Location: Republic Of Ireland
Distribution: Debian,Centos,Slackware
Posts: 485

Original Poster
Rep: Reputation: 29
read this later on:

To be able to use the newgrp command, a user has to be a member of that group.
Alternatively, a group password can be set for the group using the gpasswd com-
mand. If a user uses the newgrp command but is not a member of the target group,
the shell prompts for the group password. After you enter the correct group pass-
word, the new effective primary group is set.

i dont understand this,"a user has to be a member of that group" isnt that the point of this command to add a member to the root group?
or is it only to set it as the primary group?...so you need to be part/member of the group you want to set as the primary group...is that right?
 
Old 09-25-2016, 07:06 AM   #3
af7567
Member
 
Registered: Nov 2012
Posts: 204

Rep: Reputation: 67
newgrp is for changing what your current active group is, but you must be in that group or know the password already.

If you want to add yourself to a group use the usermod command. Look at the -a and -G options
 
Old 09-26-2016, 10:29 AM   #4
sigint-ninja
Member
 
Registered: Feb 2011
Location: Republic Of Ireland
Distribution: Debian,Centos,Slackware
Posts: 485

Original Poster
Rep: Reputation: 29
thanks for that...yes i realized my confusion...thanks for clearing it up
 
Old 09-27-2016, 03:46 AM   #5
aragorn2101
Member
 
Registered: Dec 2012
Location: Mauritius
Distribution: Slackware
Posts: 494

Rep: Reputation: 233Reputation: 233Reputation: 233
Hi,

If you want to add groups to your user, you should the usermod command instead. Read the man pages for usermod. It is quite clear. You can do all sorts of modification as well.
 
Old 09-27-2016, 07:26 AM   #6
BW-userx
Senior Member
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Void Linux / Slackware 14.2
Posts: 4,737

Rep: Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876
Quote:
Originally Posted by sigint-ninja View Post
read this later on:

To be able to use the newgrp command, a user has to be a member of that group.
Alternatively, a group password can be set for the group using the gpasswd com-
mand. If a user uses the newgrp command but is not a member of the target group,
the shell prompts for the group password. After you enter the correct group pass-
word, the new effective primary group is set.

i dont understand this,"a user has to be a member of that group" isnt that the point of this command to add a member to the root group?
or is it only to set it as the primary group?...so you need to be part/member of the group you want to set as the primary group...is that right?
oh sigint-ninja I am so surprised at you, I've have read your other posts in here and you're freaking me out now. Why is your brain telling you to make a group called root, and not something else? better take a look at your sudoers file just to see what you see.

as far as using usermod command to add users to a group. use the switches like this
Code:
#usermod -aG [groupName] [userName]
the 'a' is to append that group to the list of groups the user already has, the G is to tell the command it is to be dealing with Groups. if you just use the -G without the 'a' then you will lose every group that user was assigned to in the proccess.

Linux and Unix newgrp command

Code:
userx@voided & ~ >> $newgrp lxdm
Password: 
newgrp: crypt failed: Invalid argument
newgrp: permission denied
the newgrp is just the command used by a user to log into a different group that has already been established and set up properly in order to use its (that groups) privages

say if you have a group that has permissions to modify the printer setting how where and how to send stuff to get printed to one or more printers. then you assign some people to that group so they can fix it if it breaks. then one of them users all they have to do is log into that group to do so?

if a password was given to that group then they got a know it, or one of them users in that case could tell someone that is not in the group to log in and fix it, then give them the password or type it in for them and they now can have the groups premissions to do so? just by using the command newgrp [groupName]

that is what it looks like to me.

Last edited by BW-userx; 09-27-2016 at 08:11 AM.
 
Old 09-28-2016, 11:30 AM   #7
sigint-ninja
Member
 
Registered: Feb 2011
Location: Republic Of Ireland
Distribution: Debian,Centos,Slackware
Posts: 485

Original Poster
Rep: Reputation: 29
BW-userX "oh sigint-ninja I am so surprised at you, I've have read your other posts in here and you're freaking me out now." ??? were my other posts just as poor? or better?

anyway...i wasnt trying to make a group called root,just trying to add my user to the root group,but i understand the differences
now...and the posts here,especially yours helped clear things up.

in my defense the only time i get to do this stuff (the stuff i like) is pretty late after my working day...so forgive me if my brain backfires every once in a while...and to add..im not getting any younger here!!!

thanks again guys,as always,your the greatest!!!
 
  


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
liveCD installer asks for root password, but means the liveCD's root password newbiesforever VectorLinux 4 04-23-2013 01:16 PM
[SOLVED] Sudo command occasionally asks for root password ubuntuv Linux - Newbie 25 09-14-2010 01:26 PM
[SOLVED] Ubuntu recovery mode asks for root password Changes Linux - Newbie 15 10-12-2009 04:48 AM
SUSE asks for root password at logoff (how do I shut this off?) monkeyboy73 Linux - Desktop 4 12-14-2006 09:28 PM
Redhat 8 asks for root password before dialling head8k Linux - Newbie 9 02-21-2003 04:52 PM

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

All times are GMT -5. The time now is 02:15 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration