- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- add user using ksh
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2007 11:57 PM
тАО07-21-2007 11:57 PM
add user using ksh
I m using RHEL5. I got a interesting query from an expert. Query was as follow...
# rm -rf `Type useradd`
and also newusers command
Now add user using ksh shell ?
How can we do it? Pls suggest. Is there any command or i have to put that user entry in every file like /etc/passwd, /etc/group, and other related files
Thanks in advance
MKS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-22-2007 12:28 AM
тАО07-22-2007 12:28 AM
Re: add user using ksh
- modify /etc/passwd
- modify /etc/shadow
- modify /etc/group (maybe)
- make a new home directory
- cp /etc/skel/* to new home directory
Sure, it's easy to do with a plain shell, but 'useradd' exists to make it easier.
If you've removed it, re-install it from it's package. There's *NO GOOD REASON* to remove it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-22-2007 07:16 PM
тАО07-22-2007 07:16 PM
Re: add user using ksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-23-2007 03:00 PM
тАО07-23-2007 03:00 PM
Re: add user using ksh
Did u execute the above mentioned command?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-23-2007 09:58 PM
тАО07-23-2007 09:58 PM
Re: add user using ksh
Yes i have go through above suggetion. But i was looking for any command or other stuf
Thanks
MKS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-25-2007 01:41 AM
тАО07-25-2007 01:41 AM
Re: add user using ksh
Did he give a compelling reason like a discovered and unpatched exploit?
Or is this part of an excercise in a Linux sysadmin class?
Of course, you can add, remove and modify user accounts manually at the shell if you know which files all to edit and care for file locking.
But, if it isn't for an excercise, it is better to use commands like useradd, which can well be used in scripts, if you have to manipulate a 1000 accounts.
Think about how important files /etc/passwd and /etc/shadow are.
You don't want to lock out your users because of format errors or unsynched states.
Though I haven't got an RHES5 box I assume the package the useradd command belongs to hasn't changed.
On my RHES4 it is in the shadow-utils package, which you can reinstall:
# uname -srv;cat /etc/redhat-release; rpm -qf /usr/sbin/useradd
Linux 2.6.9-5.ELsmp #1 SMP Wed Jan 5 19:30:39 EST 2005
Red Hat Enterprise Linux WS release 4 (Nahant)
shadow-utils-4.0.3-41.1