HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- script wanted about change user profile
Operating System - HP-UX
1831664
Members
2319
Online
110029
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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-03-2004 03:46 PM
12-03-2004 03:46 PM
I have about 200 users ( eg. user1 , user2 .... ) in my system , I need to update the user profile by the below script regularly , now I need to run the below script to make it work but it is waste of time , could suggest a script so that I can make my work easily , besides , if I don't want a list of user ( eg. user10 , user35 ) will not be updated ( that mean will not change the user profile ), could suggest the script ? very thinks in advance
#passwd -x -f -n user1
#passwd -x -f -n user2
#passwd -x -f -n user3
#passwd -x -f -n user4
#passwd -x -f -n user5
#passwd -x -f -n user1
#passwd -x -f -n user2
#passwd -x -f -n user3
#passwd -x -f -n user4
#passwd -x -f -n user5
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2004 03:53 PM
12-03-2004 03:53 PM
Solution
Manually create your list of users:
# awk -F : '{print $1}' /etc/passwd > user_list
# cp user_list my_user_list
# vi my_user_list
Now make any changes -- delete users you don't want to change or whatever.
Now create the script you'll use and call it whatever you want. I called it passwd_script:
# cat passwd_script
#!/usr/bin/sh
for USER in $(cat my_user_list)
do
echo "Doing user ${USER}"
passwd -x -f -n ${USER}
done
Now do a:
# chmod 700 passwd_script
And then run it. It will go through all users in my_user_list and do the 'passwd -x -f -n' on them.
# awk -F : '{print $1}' /etc/passwd > user_list
# cp user_list my_user_list
# vi my_user_list
Now make any changes -- delete users you don't want to change or whatever.
Now create the script you'll use and call it whatever you want. I called it passwd_script:
# cat passwd_script
#!/usr/bin/sh
for USER in $(cat my_user_list)
do
echo "Doing user ${USER}"
passwd -x -f -n ${USER}
done
Now do a:
# chmod 700 passwd_script
And then run it. It will go through all users in my_user_list and do the 'passwd -x -f -n' on them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2004 05:07 PM
12-03-2004 05:07 PM
Re: script wanted about change user profile
it is ok , thx a lot
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP