- Community Home
- >
- Servers and Operating Systems
- >
- Legacy
- >
- HPE 9000 and HPE e3000 Servers
- >
- Passwd lock
HPE 9000 and HPE e3000 Servers
1824925
Members
3909
Online
109677
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
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
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
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
тАО05-16-2001 09:11 AM
тАО05-16-2001 09:11 AM
Passwd lock
I want to lock the /etc/passwd file when I or some other local SA is in it.
I also have a third party application for passwd synchronization that will require the password be locked at different times.
Does anyone know of any scripts that have already been written that will help me.
R-
I also have a third party application for passwd synchronization that will require the password be locked at different times.
Does anyone know of any scripts that have already been written that will help me.
R-
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2001 10:11 AM
тАО05-16-2001 10:11 AM
Re: Passwd lock
Hi,
If you use vipw (like most of us) you should have to worry about it for vipw when invoked creates a lock if my memory serves me..., as /etc/.pwd.lock ...
So 2 admins cannot be editing /etc/passwd at the same time...
All the best
Victor
If you use vipw (like most of us) you should have to worry about it for vipw when invoked creates a lock if my memory serves me..., as /etc/.pwd.lock ...
So 2 admins cannot be editing /etc/passwd at the same time...
All the best
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2001 10:24 AM
тАО05-16-2001 10:24 AM
Re: Passwd lock
Hi Rick,
I'm not quite sure what you mean by 'lock'. Does that mean that no users can login? Does that mean than no one else can alter the file but it can still be read?
One point to keep in mind, since anyone with UID 0 (i.e. root) and always do anything to any file any scheme you come up with will be advisory only. I would do something like this:
When you are about to alter the passwd file, test for the existence of a directory '/var/tmp/pw_lock'.
e.g.
LOCKDIR=/var/tmp/pw_lock
LOCKFILE=${LOCKDIR}/lock
if [ ! -d ${LOCKDIR} ]
then
mkdir ${LOCKDIR}
echo "${LOGNAME}" > ${LOCKFILE}
chmod 644 ${LOCKFILE}
...
do your edit stuff
rmdir -rf ${LOCKDIR}
else
echo "Passwd file is locked\c"
if [ -f ${LOCKFILE} -a -r ${LOCKFILE} ]
then
echo "by user \c"
cat ${LOCKFILE}
fi
echo
fi
------------------------
Regards, Clay
I'm not quite sure what you mean by 'lock'. Does that mean that no users can login? Does that mean than no one else can alter the file but it can still be read?
One point to keep in mind, since anyone with UID 0 (i.e. root) and always do anything to any file any scheme you come up with will be advisory only. I would do something like this:
When you are about to alter the passwd file, test for the existence of a directory '/var/tmp/pw_lock'.
e.g.
LOCKDIR=/var/tmp/pw_lock
LOCKFILE=${LOCKDIR}/lock
if [ ! -d ${LOCKDIR} ]
then
mkdir ${LOCKDIR}
echo "${LOGNAME}" > ${LOCKFILE}
chmod 644 ${LOCKFILE}
...
do your edit stuff
rmdir -rf ${LOCKDIR}
else
echo "Passwd file is locked\c"
if [ -f ${LOCKFILE} -a -r ${LOCKFILE} ]
then
echo "by user \c"
cat ${LOCKFILE}
fi
echo
fi
------------------------
Regards, Clay
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2001 10:25 AM
тАО05-16-2001 10:25 AM
Re: Passwd lock
Hi Rick:
Victor is correct. Take a look at the man pages for 'vipw' for further information.
...JRF...
Victor is correct. Take a look at the man pages for 'vipw' for further information.
...JRF...
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
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP