LinuxQuestions.org
Help answer threads with 0 replies.
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 03-04-2013, 12:46 AM   #1
TechJay
LQ Newbie
 
Registered: Mar 2013
Location: WV
Distribution: Fedorra Goddard for now
Posts: 27

Rep: Reputation: Disabled
adding users and groups


Hello all, i am a complete newb to linux but thought i should learn a little bit.. Im practicing an assignment from a book i have... Anyway, I can add new groups and a users to groups... How do i capture a users last name in the string ? ex.

useradd -G Managers Jon Smith

i tried "Jon Smith" ?

Thanks very much
 
Old 03-04-2013, 12:52 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Hi,

usernames can't have spaces in them. Also instead of using useradd you should probably be using adduser. What distro are you using?

HTH,

Evo2.
 
1 members found this post helpful.
Old 03-04-2013, 01:16 AM   #3
TechJay
LQ Newbie
 
Registered: Mar 2013
Location: WV
Distribution: Fedorra Goddard for now
Posts: 27

Original Poster
Rep: Reputation: Disabled
Thanks for the quick response. hmm everything ive looked at has said useradd... im open to anything though.. Im using Fedora 13 goddard i believe..

So there is no way to add the space in my username ? or is there a global acceptance of a symbol such as _ - or something ? Im a computer science major i program in java and perl. I took intro to linux as an elective just because i thought i should know a little something. Im reviewing a case study for practice on my midterm .. Ive been going step by step and trying each ive made it to the adduser or useradd part.

1. You will need to install Linux on the computer you have been assigned
 Install Via NFS. Installation source files are available on the NFS server. Ask your instructor for the following parameters:
 NFS Server Name/IP: ___________________
 NFS Server folder: _____________________
 Use the following parameters:
 Install the boot loader to the Master Boot Record, and do not set a boot loader password
 Configure partitions as follows:
• /boot should be a 500 MB primary partition on the first SCSI hard drive
• Swap space should be approximately 768 MB on the first SCSI hard drive
• / should take up the remaining space on the first SCSI hard drive
• /home should use all of the second SCSI hard drive
 Configure networking to use DHCP. Set a host name of your first and last name, with no spaces
 Disable the firewall
 Select the following packages:
• X Window System
• Gnome Desktop
• KDE Desktop
• Editors
• Graphical Internet
• Text Internet
• Server configuration tools
• Development Tools
• Kernel Development
• Administration Tools
• System Tools
• Printing Support
2. Once the system is installed, configure the following:
 Change the default timeout in GRUB to five seconds
 As the root user, create a cron job in the root user’s cron table (not the system table) that will run at 2:10 AM every day and run the command
yum –y update
 Install the switchdesk utility with yum.
 Configure user disk quotas on the /home partition so that each user can have a maximum of 100 files and 100 MB of data.
3. There are six divisions within Innitech, with a number of employees working in each division.
 You will need to create a group for each division
 You will need to create user accounts and assign passwords for each of the employees
 Use a naming convention of firstnamelastname for each user
 Set the initial password for all accounts to penguin
 You will need to assign the employees to the appropriate group on the server
 Divisions and Employees are as follows:
• Managers
• Bill Lumbergh
• Dom Portwood
• Peter Gibbons
 Change Peter’s default desktop to KDE using switchdesk
• Marketing
• Milton Waddams
 Lock Milton’s account
• Sales
• Tom Smykowski
• Steve Magazine
• Software
• Michael Bolton
• Samir Nagheenanajar
• IT
• Your account
• Your instructor’s account
• Human Resources
• Bob Slydell
• Bob Porter
4. On the server, you will need to create a common folder for each of the users and groups to manage their work and data:
 Create a common folder called /data
 Under this, create a folder for each group, using the group’s name
 Set the appropriate standard and special file system permissions so that anything created or placed in the folders will be owned by the group, and users cannot delete other peoples work, only their own
 Add the appropriate folders to each user’s PATH variable when they log in
 Set each user’s prompt in the Software group to display the username, and the current directory each time they log in
 Install a printer. Ask your instructor for the following information:
• Make/Model: _______________
• Printer Name/IP: ____________
5. Create a scheduled task in the root user’s cron table (not the system cron table) that will dump the day’s system log files from /var/log/secure and /var/log/messages to a common file called logs for managers under the managers shared folder. The logs file should be overwritten each day.
6. Using tar and gzip, create a compressed backup of the /home folder and all of its contents, and save it to the IT group’s common folder. Next, using the mkisofs command, create an ISO image of the /data folder, called databackup.iso, and store it in the root user’s home directory.

i skipped the disk quotas until ive added the user... Im sure after i get through this ill have a few more questions about permissions and the gzip backup.. Thanks ... sorry for the long post just thought it would help for you to see what i was working with.

Last edited by TechJay; 03-04-2013 at 01:21 AM.
 
Old 03-04-2013, 01:35 AM   #4
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Hi,

technically the name you pass to adduser (and to useradd) is actually the users "login name". This should be lowercase possibly with numbers. Typically it will be just the given or family name of the user, or perhaps their initials. So the user John Smith might have the login "jon", "smith", "jsmith", etc. Each user on the system can also have a real name. See the /etc/passwd man page.
Code:
man 5 passwd
If you use adduser instead of useadd you will be prompted to enter various information including the users actual name.

Fedora 13 is pretty ancient and AFAIK unmaintained, but I it should have adduser.

Evo2.
 
2 members found this post helpful.
Old 03-04-2013, 01:39 AM   #5
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Hi,

Quote:
Originally Posted by TechJay View Post
 Use a naming convention of firstnamelastname for each user
Ahh, it seems you are supposed to use jonsmith as the login for Jon Smith.

Evo2.
 
1 members found this post helpful.
Old 03-04-2013, 01:44 AM   #6
TechJay
LQ Newbie
 
Registered: Mar 2013
Location: WV
Distribution: Fedorra Goddard for now
Posts: 27

Original Poster
Rep: Reputation: Disabled
Thanks a lot.. Ill visit the man page u mentioned.. I dont know much about diff distros.. I tried the adduser -G Managers Bill ad it worked but never prompted me for more information such as real name.. also would you recomend skipping the disk quota part ? can i set it to a "default" for new users before they are created ??

Last edited by TechJay; 03-04-2013 at 01:47 AM.
 
Old 03-04-2013, 02:02 AM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
1. set user's quotas after creating users. You can use a prototype user, then tell system to copy that setting for each user eg
Code:
# implement a policy for user1
edquota user1

# make user2 settings same as user1
edquota -p user1 user2
This is a good Linux tutorial
http://rute.2038bug.com/index.html.gz

This is a RHEL Admin manual, should be mostly same cmds for you
http://www.linuxtopia.org/online_boo...ion/index.html

Searchable HTML version of man pages
http://linux.die.net/man/
 
1 members found this post helpful.
Old 03-04-2013, 02:04 AM   #8
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Hi,

Quote:
Originally Posted by TechJay View Post
Thanks a lot.. Ill visit the man page u mentioned.. I dont know much about diff distros.. I tried the adduser -G Managers Bill ad it worked but never prompted me for more information such as real name..
I just did a quick google and it looks like on F16 adduser is exactly the same as useradd :-(

Note that with the command you ran above the login of that user will be "Bill", but from the instructions you posted it should be billlumbergh.

You can adjust the properites of a user (including their login name) using usermod or by editing /etc/passwd (probably should use vipw for that). You can also change (or set) the users password with the passwd command.
Code:
man 1 passwd
man 8 usermod
Quote:
also would you recomend skipping the disk quota part ? can i set it to a "default" for new users before they are created ??
Sorry I'm not familiar with setting up dist quotas on Fedora.

Evo2.
 
1 members found this post helpful.
Old 03-04-2013, 02:05 AM   #9
TechJay
LQ Newbie
 
Registered: Mar 2013
Location: WV
Distribution: Fedorra Goddard for now
Posts: 27

Original Poster
Rep: Reputation: Disabled
Thats awesome.. glad i posted some stuff now... very efficient thank u
 
  


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
[SOLVED] Adding users to multiple groups in Openldap skimeer Linux - Newbie 1 09-03-2012 02:36 AM
several questions about ldap (adding new groups/users/etc) ncsuapex Linux - Server 9 05-26-2009 01:23 PM
Creating groups and adding users to that group tehfatal Linux - Newbie 2 04-01-2007 01:42 AM
adding users to groups in with in console binary1011100 Linux - Newbie 3 11-18-2006 03:15 PM
creating groups, adding users, and setting permissions bowie101 Linux - Newbie 2 11-23-2005 01:42 PM


All times are GMT -5. The time now is 02:28 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