- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Need help with a 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
11-13-2007 04:49 AM
11-13-2007 04:49 AM
can anyone help me with this? thanks so much.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2007 05:22 AM
11-13-2007 05:22 AM
SolutionHmmm. OK, you can do this:
# cat .fixme
#!/usr/bin/sh
while read NAME
do
GROUP=$(awk -F: -v NAME=${NAME} '$1==NAME {print $4}' /etc/passwd)
echo chown -R ${NAME} ${GROUP} /home/${NAME}
done < usernames
...where 'usernames' has the account names to "fix", one per line.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2007 05:24 AM
11-13-2007 05:24 AM
Re: Need help with a script
Actually you need to compare the system with an undamaged one and make the change.
ls -R > good.sys.txt
ls -R > bad.sys.txt
You may need to do this directory by directory.
You can't just remap things from /etc/passwd.
If it were Linux, you could do an rpm -qf for every rpm and use that to check and change the ownership.
This is a process that involves manual work. Its also a good way for a junior admin to pay for his/her mistake and learn the importance of permissions.
After that a test plan.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2007 06:31 AM
11-13-2007 06:31 AM
Re: Need help with a script
Well, is appears that my second comment in your duplicate post in the Language family was deleted by a moderator because you posted your query twice.
Thus:
If by "main home directory" you do NOT mean '/home' but rather something disasterous like '/', then:
# swverify -F \*
...will repair the permissions and ownership of products and patches represented by entries in the IPD (Installed Product Database --- '/var/adm/sw').
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2007 06:34 AM
11-13-2007 06:34 AM
Re: Need help with a script
ALSO, please re-examine your earlier thread here:
https://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1144475
...to see if the answers therein answered that query. Thanks!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2008 04:21 PM
01-08-2008 04:21 PM