- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Directory permissions
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
09-05-2003 01:42 AM
09-05-2003 01:42 AM
I have a question about two complete different users that need to have read/write access in the same directory.
Both users should be able to add files in that dir, but the new files should always have the same ownership :
drwxrwx--- ftpuser applgroup 1024 /ftp/in
Each file that is created should get above UID and GROUPID OWNER. By setting an s bit on the group does not make any difference. By setting permission as :
drwxrws---
will create files still under it's own USERid. Does anyone know a method how to always set the permission to the above standard ??
Regs David
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2003 02:25 AM
09-05-2003 02:25 AM
Re: Directory permissions
I don't think there is any direct way to do this. When created files is always owned by the creator.
Some suggestions:
- Pre-create the files as empty files with correct owner.
- If possible, have the application to change owner.
- Running a cron job every 10 minute (for ex.) which find and changes the files with wrong owner.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2003 02:26 AM
09-05-2003 02:26 AM
Re: Directory permissions
You must add the two users to a common group, this can be a secondary group, then with the s bit set on in the directory, the two users can share the files in that directory.
The new files created will have user and group permissions and there will be no problems to share.
Frank.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2003 03:02 AM
09-05-2003 03:02 AM
Solutionchange inittab to respawn this "daemon" script in run level 3
###############################################
#!/bin/sh
cd /your_ftp_dir
while true
do
ll | grep -v total | while read line
do
if [ `echo $line | awk '{print $3}'` != ftpuser ] || [ `echo $line | awk '{print $4}'` != applgroup ] || [ `echo $line | awk '{print $1}'` != '-rwxrwx---' ]
then
chown ftpuser *
chgrp applgroup *
chmod 750 *
fi
done
done
###############################################
Regards,
Bernhard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2003 04:16 AM
09-05-2003 04:16 AM
Re: Directory permissions
Thanks for all your help !
Bernhard; It doesn't solve my issue as prefer not to use that many extra entries (I need multiple of these users). Still your time in this deffinitly earnes a 8 points !!
Thanks for your help
Regs David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2003 05:12 AM
09-05-2003 05:12 AM
Re: Directory permissions
something really alternative....
Make use of ftpaccess: you can define that files delivered into a certain users' home directory via ftp should be owned by a certain user, belong to a certain group and have certain predefined permissions.
(man ftpaccess, search for the keyword upload to see the examples.)
One tricky thing is that the file destination dir must be an ftp users' home directory: in the script below the file david ends in the home dir of the xxxxxx user.
Another tricky thing is of course to make use of this facility without the user being aware of making an ftp session.
I have just tried this primitive script, ftpjk, which tries to hide the ftp session for the user:
#!/usr/bin/sh
# cd to where the file is
cd /tmp/jxk
YOUR_MACHINE=$(uname -n)
USERNAME=xxxxxx
PASSWORD=yyy1234
(
echo "
open $YOUR_MACHINE
user $USERNAME $PASSWORD
put $1
close
"
) | ftp -i -n
# end of script.
the source file used to put into the xxxxxx users home directory:
ls -l /tmp/jxk/david
-rw-r--r-- 1 jxk users 0 Sep 5 14:38 /tmp/jxk/david
the filename used as parameter for the above script:
# ./ftpjk david
and when david appeared in the xxxxxx users' home dir, it had these permissions:
-rw-rw-rw- 1 root dba 0 Sep 5 14:39 david
because of the upload config in /etc/ftpd/ftpaccess.
Perhaps you can elaborate on it yourself.
regards,
John K.