LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 10-09-2006, 03:56 PM   #1
Relja
Member
 
Registered: Oct 2002
Location: Belgrade, Yugoslavia
Distribution: Linux Mandrake 10.0
Posts: 71

Rep: Reputation: 15
Question Create new user and copy the privilages


Hello,

My friend has administrative rights on a server running Ubuntu and I often login using his account. But we would like to create a new user account for me that would be identical to the one that already exists (ie to have all the same privilages). How can I do this?
I am logging in using putty, so I only have the command line available.

Thank you very much
Relja
P.S. I am quite new to linux. Had a bit of experience with it since I used if for 2/3 years, but I know only very basic stuff..
 
Old 10-09-2006, 04:30 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
I would say to just make sure your user belongs to all the same groups that he does (including his username group). That should fix most of it, I believe.
 
Old 10-09-2006, 06:21 PM   #3
Relja
Member
 
Registered: Oct 2002
Location: Belgrade, Yugoslavia
Distribution: Linux Mandrake 10.0
Posts: 71

Original Poster
Rep: Reputation: 15
Thanks for the answer - but I probably wasn't clear enough.
I don't really know how to create a user, how to make him belong to some groups etc.. So if someone could write the relevant commands so that I can maybe explore a bit more about them on google or something.
Thanks
 
Old 10-09-2006, 07:52 PM   #4
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
First, as your friend's user, type groups and write down all the groups he belongs to (like adm, floppy, cdrom, users, etc). Then type
Code:
sudo useradd -G adm,disk,dialout,cdrom,floppy,audio newusername
This should add a new user with login newusername and a home directory, etc, etc. The -G switch is followed by the list of groups you copied down, these are the supplemental groups you want to belong to.
 
Old 10-09-2006, 08:12 PM   #5
Relja
Member
 
Registered: Oct 2002
Location: Belgrade, Yugoslavia
Distribution: Linux Mandrake 10.0
Posts: 71

Original Poster
Rep: Reputation: 15
Thanks very much. I found out which groups does my friend belong to (by typing in groups). Then I did the sudo command, and it got executed without any errors/warnings.. But then (after searching a bit more on the useradd command) I tried

Code:
passwd newusername
But that gives an error that the user doesn't exist? The same error appears if I try
Code:
groups newusername
Thanks
 
Old 10-09-2006, 08:40 PM   #6
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
Did you do sudo passwd newusername?

Also, you'll need to add your newusername to the sudoers file. As your friends user type sudo visudo then edit the file so that a similar line occurs to your friends (just change the username).
 
Old 10-10-2006, 04:43 AM   #7
Relja
Member
 
Registered: Oct 2002
Location: Belgrade, Yugoslavia
Distribution: Linux Mandrake 10.0
Posts: 71

Original Poster
Rep: Reputation: 15
Now I get the permission denied error, which probably means that my friend's account doesn't have root privilages as we originally tought. Thank you very much for all the help and I think that it will all be working once we contact the real administrator..
 
  


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
Create script in CentOS4 to copy folder but promt user to enter name of destination mastermindpr Linux - General 2 02-08-2006 11:45 AM
Linux live-cd to create HD copy over the LAN ? hq4ever Linux - Software 9 12-10-2005 07:34 AM
Root User Privilages Jonlinuxuser Linux - Software 1 05-17-2004 07:58 PM
FAM monitoring file opened/create/copy laikos Programming 0 03-07-2004 03:57 AM
NTFS drive - no user privilages - root only jon_k Linux - Software 2 09-01-2003 06:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 01:42 PM.

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
Open Source Consulting | Domain Registration