Results 1 to 4 of 4
Hi all,
I am working in a lab where it is often useful to copy folders from one user's home directory on a machine to another user's on the same ...
- 05-15-2008 #1Just Joined!
- Join Date
- May 2008
- Posts
- 1
Copying files between users
Hi all,
I am working in a lab where it is often useful to copy folders from one user's home directory on a machine to another user's on the same machine. I think a simple cp does not work because of permission errors. What is the easiest way to do this?
Thanks!
Cameron
- 05-15-2008 #2
Have you tried using cp to copy the folder and then chown to change owner?
If you regularly need to share information you could also try setting up a folder and allow all read/write access ... then the users could copy the information rather than root.
- 05-15-2008 #3Just Joined!
- Join Date
- Jul 2007
- Posts
- 49
You could use sudo cp /home/usera/file /home/userb/
as long as you have permissions to run sudo cp (set in the sudoers file) then chown the moved file
- 05-15-2008 #4Linux Guru
- Join Date
- Nov 2007
- Location
- Córdoba (Spain)
- Posts
- 1,513
sshfs is my choice, for both local or remote mounts. It doesn't matter.
For example, if I am the user i92guboj, I can mount the home dir of the user clara under my home this way:
The general schema is:Code:sshfs clara@server:/home/clara ~/clara/
It doesn't matter if you do it in a local or remote machine. In any case, the server needs to be running the ssh daemon, of course.Code:sshfs <user>@<server>:</home/dir/server/side> ~/local/mount/point/
If you setup passwordless authentication for ssh, then you will not need to enter keys to mount the directory.
The advantage is that, on the client side, the files will seem as owned by you, and on the server side, the files will be seen as owned by the user that you used to login (clara in my example). So, no one suffers, and the exchange is still secure.


Reply With Quote