1.

Solve : I need help with Linux?

Answer»

Hello everybody.
I need to do a homework, and I have almost all of it done, but there are two exercises I don´t know how solve them. I have Suse Linux 8.1

The first is making a new USER. Well, I write as root in bash console: useradd newus
Well, I have the new user now.
Then, I must create a new group. Well, I write as root in bash console: groupadd newg
And already I have the new group.
After this, I must allocate the user newus at the group newg. Well, I change before to the user: su newus
And after this, I write as the user, in bash console: newgrp newg
And bash tells me: passwd
I have test with it all my known passwords, but after a few seconds, bash tells me : sorry

And I can´t allocate the new user at the new group. I think this must to do with permissions....

Could you help me to solve this?

I only need create a new user, a new group and allocate the new user in the new group.
Thanks.
You have to do this from the root account, or if doing this way, the password being asked for should be the one to the root account.Thanks very much for your response.

Well, like I said, I´ve created the new user and new group from the root account, after this, like the Linux manual say, I´ve changed to new user account by "su newus" order, and once changed, I try to give the new user to the new group, and I´ve tryed all the passwords I know in my Linux OS, (root password and default user password, and newus password), and OS always say the same "sorry", and I can´t do.
I think this might to see with permission of new group, or maybe with newus permission, cause the OWNER of the newgr (new group) or maybe the newus (new user).

Please, if you have a Linux OS, try to create a new user and a new group and try to put in the new group the new user. And tell me the story afterwards
For a better comprehension and understanding of this PROBLEM, I have cut and paste the piece of code I have write and it´s the problem.

[emailprotected]:/> su root (because I have entered in the system like user ketk, I change to root)
Password: (I write my root password)
linux:/ # useradd jhon (I add a new user as jhon)
linux:/ # groupadd gathaca (I add a new group called gathaca)
linux:/ # passwd jhon (I´m going to give jhon a password)
Changing password for jhon. (System says "yes")
New password: (I write the password for jhon)
Re-enter new password: (I re-write the password again)
Password changed (System says "ok").
linux:/ # su jhon (I change to user jhon from root)
[emailprotected]:/> newgrp gathaca jhon (I try to assign gathaca group to user jhon)
Password: (System ask me for jhon password)
Sorry. (System says me "NO")
[emailprotected]:/> | (And this is the END, I can´t give gathaca group to user jhon...)

Is it now so clear the problem I have?
Thanks for reading me...newgrp is the wrong command to use here. Try man usermod.Ok, thanks, I´m gonna do it.
Ok, thanks that is the solution.
I have copied all commands as follows:

[emailprotected]:/> su root (because I have entered in the system like user ketk, I change to root)
Password: (I write my root password)
linux:/ # useradd john (I add a new user as john)
linux:/ # groupadd gathaca (I add a new group called gathaca)
linux:/ # passwd john (I´m going to give john a password)
Changing password for jhon. (System says "yes")
New password: (I write the password for jhon)
Re-enter new password: (I re-write the password again)
Password changed (System says "ok").

CAT /etc/passwd (OS gives a lot of lines but the main is:)
......
john:x:501:100::/home/john:/bin/bash

cat /etc/group (OS gives a lot of lines but the main is:)
......
gathaca:x:500:

usermod -G 500 john (and OS says YES!!!!)

cat /etc/group (OS gives a lot of lines but the main is:)
......
gathaca:x:500: john (this means jhon user is in gathaca group)



THANKS; THANKS; THANKS; THANKS A LOT A LOT.....

You're welcome. For future reference, the command apropos is a useful way of searching for relevant man pages. "apropos user" would have brought up a list of all the user commands, including usermod.Thanks very much for the information. Without your helo I couldn´t do my last homework...
Thanks very much.



Discussion

No Comment Found