Re: [gentoo-user] File permissions and such
On Sunday 03 June 2007, Dan Cowsill wrote: > Hey list, > > It has been a constant burden to me to have to change the file > permissions of files I've copied so that other users can access them > and modify them. Say I have a number of documents in the /root > folder which the root user owns. Now I want to transfer them to my > non-priveliged user so I can work on them... But I have to chown them > so that is possible. > > It just occured to me that there must be an easier way to do things > like this and I was wondering if you fine fellows could guide me down > the right path. A custom script? Maybe something like (named as chowncp) #!/bin/bash # chown $1 $2 cp $2 $3 Permissions would be something like x only for owner (root), called something like this: chowncp dan It's way incomplete, I'll let you figure out your own '[ -f ...' checks but you get the idea. I'm also sure ext3/reiser acls can force ownership of new files (it can do it for groups), but I'm way too lazy to figure it out right now, it being Friday and all... alan -- Optimists say the glass is half full, Pessimists say the glass is half empty, Developers say wtf is the glass twice as big as it needs to be? Alan McKinnon alan at linuxholdings dot co dot za +27 82, double three seven, one nine three five -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] File permissions and such
Alan McKinnon wrote: > On Saturday 26 May 2007, Dale wrote: > >> Dan Cowsill wrote: >> >>> Hey list, >>> >>> It has been a constant burden to me to have to change the file >>> permissions of files I've copied so that other users can access >>> them and modify them. Say I have a number of documents in the >>> /root folder which the root user owns. Now I want to transfer them >>> to my non-priveliged user so I can work on them... But I have to >>> chown them so that is possible. >>> >>> It just occured to me that there must be an easier way to do things >>> like this and I was wondering if you fine fellows could guide me >>> down the right path. >>> >>> Thanks. >>> >> If you use KDE, you can right click on the folder that contains them >> and change the permissions then check the box that says to make it >> apply to everything in the folder. >> > > chmod -R > chown -R (this one only works for root) > > >> That way you can change a lot of >> them at once. I also noticed a while back that if I am in Konqueror >> as root and copy to my user desktop, it changes the permissions to my >> regular user. I never noticed that before. >> > > Ye gods. Why are you running KDE as root ???!!!??? > I'm not running KDE as root, I'm running Konqueror as root. Actually, mine is set up so you can't run KDE as root. We all should know that is not a good idea. Dale :-) :-) :-) -- www.myspace.com/-remove-me-dalek1967 Copy n paste then remove the -remove-me- part.
Re: [gentoo-user] File permissions and such
On Monday 28 May 2007, Neil Bothwick wrote: > On Mon, 28 May 2007 13:52:34 +0200, Alan McKinnon wrote: > > > I also noticed a while back that if I am in Konqueror > > > as root and copy to my user desktop, it changes the permissions > > > to my regular user. I never noticed that before. > > > > Ye gods. Why are you running KDE as root ???!!!??? > > He's not, otherwise the desktop would belong to root as well as the > Konqueror process. Ah yes, my bad. I didn't realise at first that Dale meant he started konqueror as root from a desktop running as a user alan -- Optimists say the glass is half full, Pessimists say the glass is half empty, Developers say wtf is the glass twice as big as it needs to be? Alan McKinnon alan at linuxholdings dot co dot za +27 82, double three seven, one nine three five -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] File permissions and such
On Mon, 28 May 2007 13:52:34 +0200, Alan McKinnon wrote: > > I also noticed a while back that if I am in Konqueror > > as root and copy to my user desktop, it changes the permissions to my > > regular user. I never noticed that before. > > Ye gods. Why are you running KDE as root ???!!!??? He's not, otherwise the desktop would belong to root as well as the Konqueror process. -- Neil Bothwick Copper wire was invented by two Scotsmen fighting over a penny! signature.asc Description: PGP signature
Re: [gentoo-user] File permissions and such
On Saturday 26 May 2007, Dale wrote: > Dan Cowsill wrote: > > Hey list, > > > > It has been a constant burden to me to have to change the file > > permissions of files I've copied so that other users can access > > them and modify them. Say I have a number of documents in the > > /root folder which the root user owns. Now I want to transfer them > > to my non-priveliged user so I can work on them... But I have to > > chown them so that is possible. > > > > It just occured to me that there must be an easier way to do things > > like this and I was wondering if you fine fellows could guide me > > down the right path. > > > > Thanks. > > If you use KDE, you can right click on the folder that contains them > and change the permissions then check the box that says to make it > apply to everything in the folder. chmod -R chown -R (this one only works for root) > That way you can change a lot of > them at once. I also noticed a while back that if I am in Konqueror > as root and copy to my user desktop, it changes the permissions to my > regular user. I never noticed that before. Ye gods. Why are you running KDE as root ???!!!??? Dan, There's no easy way to do this. As a user you have to assign group and/or other access to the files manually. You can't chown them (only root can do that). Another alternative is to create a dir somewhere exclusively for the purpose of sharing stuff, make it owned by root, group owned by some share group. Set gid on the directory, every new file/dir copied/moved/created there will now be owned by the share group. Make sure the relevant users are members of this group: mkdir /shared-stuff chown -R root:share /shared-stuff chmod g+s /shared-stuff To set the group write permission on all these new items, either change the users' umask (ugh!) or use an acl (slightly less ugh!) alan -- Optimists say the glass is half full, Pessimists say the glass is half empty, Developers say wtf is the glass twice as big as it needs to be? Alan McKinnon alan at linuxholdings dot co dot za +27 82, double three seven, one nine three five -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] File permissions and such
On Saturday 26 May 2007 15:58, Albert Hopkins wrote: > [ Since I gone ahead and polluted the list I'll give my take ] > > On Sun, 2007-06-03 at 14:36 -0400, Dan Cowsill wrote: > > It has been a constant burden to me to have to change the file > > permissions of > > > files I've copied so that other users can access them and modify them. > > Say I > > > have a number of documents in the /root folder which the root user > > owns. Now > > > I want to transfer them to my non-priveliged user so I can work on > > them... > > > But I have to chown them so that is possible. > > > > It just occured to me that there must be an easier way to do things > > like this > > > and I was wondering if you fine fellows could guide me down the right > > path. > > > In my experience it's very rare that root would need to do it. If root > is reserved mostly for doing those dirty sys-admin tasks then it needn't > worry much about file sharing with those pesky users, so far as to say > the usual root-shared files (libraries, executables, /usr/share, etc.) > > Usually it's the case that a) Users need to share a file with root or b) > users need to share files with each other. In the former case it's > trivial. All your file are belong to root. In the latter case, there > are varying methods of doing it, depending on the desired effect. If > it's just a one-time thing usually you'll deposit a file in /tmp > or /var/tmp and share it there. Another way is to consider a group of > users are working a project. Call it project1. > > Create a group called project1: > $ groupadd project1 > > Add users to the group: > $ gpasswd -a user1 project1 > $ gpasswd -a user2 project1 > $ gpasswd -a user3 project1 > > Create a shared directory for the group: > $ mkdir -p /usr/local/projects/project1 > $ chgrp project1 /usr/local/projects/project1 > $ chmod g+s /usr/local/projects/project1 > > Then, depending on your user's umask's they should all have access to > files created in that directory. > > You could also use ACLs but you need make sure your kernel and toolset > is configured for it. > > But I can't remember the last time i needed to share anything in /root > with a non-root user. > -- > Albert W. Hopkins Hey, thanks that makes sense :) Thanks again. -- --- Dan Cowsill http://www.danthehat.net/ GnuPG Public Key: http://www.danthehat.net/wp-content/uploads/public.asc pgpTNNXnqf95a.pgp Description: PGP signature
Re: [gentoo-user] File permissions and such
[ Since I gone ahead and polluted the list I'll give my take ] On Sun, 2007-06-03 at 14:36 -0400, Dan Cowsill wrote: > It has been a constant burden to me to have to change the file permissions of > files I've copied so that other users can access them and modify them. Say I > have a number of documents in the /root folder which the root user owns. Now > I want to transfer them to my non-priveliged user so I can work on them... > But I have to chown them so that is possible. > > It just occured to me that there must be an easier way to do things like this > and I was wondering if you fine fellows could guide me down the right path. In my experience it's very rare that root would need to do it. If root is reserved mostly for doing those dirty sys-admin tasks then it needn't worry much about file sharing with those pesky users, so far as to say the usual root-shared files (libraries, executables, /usr/share, etc.) Usually it's the case that a) Users need to share a file with root or b) users need to share files with each other. In the former case it's trivial. All your file are belong to root. In the latter case, there are varying methods of doing it, depending on the desired effect. If it's just a one-time thing usually you'll deposit a file in /tmp or /var/tmp and share it there. Another way is to consider a group of users are working a project. Call it project1. Create a group called project1: $ groupadd project1 Add users to the group: $ gpasswd -a user1 project1 $ gpasswd -a user2 project1 $ gpasswd -a user3 project1 Create a shared directory for the group: $ mkdir -p /usr/local/projects/project1 $ chgrp project1 /usr/local/projects/project1 $ chmod g+s /usr/local/projects/project1 Then, depending on your user's umask's they should all have access to files created in that directory. You could also use ACLs but you need make sure your kernel and toolset is configured for it. But I can't remember the last time i needed to share anything in /root with a non-root user. -- Albert W. Hopkins -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] File permissions and such
Am Sonntag, 3. Juni 2007 schrieb Dan Cowsill: > It just occured to me that there must be an easier way to do things like > this and I was wondering if you fine fellows could guide me down the right > path. I guess you should use a shared directory together with a dedicated group, for example: 1) Create a group "workers" and add all users which should work on the same set of documents to this group (users must log out and in again for the change to be visible for them). 2) Create a new directory for shared documents, lets say "/work", chown it to "root:workers" and and set the "s" bit for the group (chmod g+s /work). This way, all files created in this directory will automatically be assigned to group "workers". Another posibility would be to use ACLs. HTH... Dirk signature.asc Description: This is a digitally signed message part.
Re: [gentoo-user] File permissions and such
Sorry about that going to the list. It was meant to be a direct reply. -- Albert W. Hopkins -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] File permissions and such
On Saturday 26 May 2007 14:55, Albert Hopkins wrote: > Don't know if you're aware of this, but the emails you are sending have > Date headers which are WAY into the future. For example, the email you > sent that I'm applying to (which I think was sent today) is dated. June > 03. Another one you sent a few days ago was dated 31 May. > -- > Albert W. Hopkins I wasn't aware, thanks :) -- --- Dan Cowsill http://www.danthehat.net/ GnuPG Public Key: http://www.danthehat.net/wp-content/uploads/public.asc pgp17hrz3EeS7.pgp Description: PGP signature
Re: [gentoo-user] File permissions and such
Dan Cowsill wrote: > Hey list, > > It has been a constant burden to me to have to change the file permissions of > files I've copied so that other users can access them and modify them. Say I > have a number of documents in the /root folder which the root user owns. Now > I want to transfer them to my non-priveliged user so I can work on them... > But I have to chown them so that is possible. > > It just occured to me that there must be an easier way to do things like this > and I was wondering if you fine fellows could guide me down the right path. > > Thanks. > If you use KDE, you can right click on the folder that contains them and change the permissions then check the box that says to make it apply to everything in the folder. That way you can change a lot of them at once. I also noticed a while back that if I am in Konqueror as root and copy to my user desktop, it changes the permissions to my regular user. I never noticed that before. Does that help? Dale :-) :-) :-) -- www.myspace.com/-remove-me-dalek1967 Copy n paste then remove the -remove-me- part. -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] File permissions and such
Don't know if you're aware of this, but the emails you are sending have Date headers which are WAY into the future. For example, the email you sent that I'm applying to (which I think was sent today) is dated. June 03. Another one you sent a few days ago was dated 31 May. The relevant headers: From: Dan Cowsill <[EMAIL PROTECTED]> To: gentoo-user@lists.gentoo.org Subject: [gentoo-user] File permissions and such Date: Sun, 3 Jun 2007 14:36:07 -0400 User-Agent: KMail/1.9.5 Message-Id: <[EMAIL PROTECTED]> -- Albert W. Hopkins -- [EMAIL PROTECTED] mailing list
[gentoo-user] File permissions and such
Hey list, It has been a constant burden to me to have to change the file permissions of files I've copied so that other users can access them and modify them. Say I have a number of documents in the /root folder which the root user owns. Now I want to transfer them to my non-priveliged user so I can work on them... But I have to chown them so that is possible. It just occured to me that there must be an easier way to do things like this and I was wondering if you fine fellows could guide me down the right path. Thanks. -- --- Dan Cowsill http://www.danthehat.net/ GnuPG Public Key: http://www.danthehat.net/wp-content/uploads/public.asc pgpphMVWtibcH.pgp Description: PGP signature