- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: useradd script
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
Forums
Discussions
Discussions
Discussions
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
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
12-06-2000 10:13 AM
12-06-2000 10:13 AM
I would like to know if someone out there has improved the useradd script to do the following:
1) Look at the last entry in /etc/passwd and increment the UID by 1.
2) create the account (obviously)
3) assign it's initial password
4) Create their home directory.
5) Assign their group (default)
6) Did I miss something?
Suggestions/help appreciated.
Thanks,
Nickd
You gotta love these forums!!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2000 10:30 AM
12-06-2000 10:30 AM
Re: useradd script
Any outomatic script to add users has security implications especially asigning a password, it is by far safer to add your users yourself.
Using SAM will make the task slightly easier for you.
I am sure that many sysadmins will agree with me that doing it youself makes you aware of who is on your system and what that user is allowed to do.
HTH
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2000 10:32 AM
12-06-2000 10:32 AM
Re: useradd script
Thanks, I am fully aware of the security implications. I personally don't like to use Sam and would prefer to do it through vi. I was just looking for some automation, ok leaving out the password setting.
Thanks,
Nickd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2000 10:36 AM
12-06-2000 10:36 AM
SolutionRegarding the password is concerned, you can edit (ofcourse thru script) and put an encrypted version of the password which you already know. But this is not recomended.
PS: The script doesn't include this part of useradd
Thanks,
Madhu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2000 10:56 AM
12-06-2000 10:56 AM
Re: useradd script
This small script can be modified to make life easier - on option 1 I presumed that you would wish to look at the group file first to get the new users group.
-------------cut here----------------
continue="yes"
while [ "$continue" = "yes" ]
do
clear
echo "--------------------------------- "
echo " MENU "
echo " ----------------------- "
echo "| |"
echo "| 1 : Which group |"
echo "| 2 : 2nd bit |"
echo "| 3 : 3rd bit |"
echo "| 4 : 4TH bit |"
echo "| x : EXIT |"
echo " ---------------------- "
echo "| |"
echo " ---------------------- "
read ans
case $ans in
1) cat /etc/group|more
;;
2) 2nd bit
;;
3) 3 rd bit
;;
4) passwd
x) continue="no"
;;
X) continue="no"
;;
esac
done
---------------cut here-------------
HTH
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2000 05:11 AM
12-12-2000 05:11 AM
Re: useradd script
Your script works fairly well, but it would be perfect if it would prompt me for the new userid first rather than include it in the script.
Nickd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2000 07:07 AM
12-12-2000 07:07 AM
Re: useradd script
I have a small script to add many users ata time. This wrked fine during a major cut-over.
Hope this proves useful ....
Suhas.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2000 10:18 AM
12-12-2000 10:18 AM
Re: useradd script
USER=$1
GROUP=$2
useradd -g $GROUP -d /users/$USER -s /usr/bin/ksh -m -k /etc/skel/$GROUP $USER echo "\n\n$USER created and added to $GROUP\n
AUTHNUM=`/usr/lbin/modprpw -x $USER|awk -F= '{print $2}'`
echo "\nAuthorization number for $USER is $AUTHNUM"
echo "Press return"
read ans
return
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2000 11:25 AM
12-12-2000 11:25 AM
Re: useradd script
Enjoy !
...Madhu