Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > Linux Newbie
Reload this Page Copying files between users
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Linux Newbie If you're new to the wonderful world of Linux, start here!

Reply
 
Thread Tools Display Modes
Old 05-15-2008   #1 (permalink)
cmckinn
Just 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
cmckinn is offline   Reply With Quote
Old 05-15-2008   #2 (permalink)
Jonathan183
Linux Engineer
 
Join Date: Oct 2007
Location: Bristol, UK
Posts: 1,325
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.
Jonathan183 is offline   Reply With Quote
Old 05-15-2008   #3 (permalink)
kazler
Just Joined!
 
Join Date: Jul 2007
Posts: 29
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
kazler is offline   Reply With Quote
Old 05-15-2008   #4 (permalink)
i92guboj
Linux Engineer
 
Join Date: Nov 2007
Location: Córdoba (Spain)
Posts: 896
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:

Code:
sshfs clara@server:/home/clara ~/clara/
The general schema is:

Code:
sshfs <user>@<server>:</home/dir/server/side> ~/local/mount/point/
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.

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.
i92guboj is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT. The time now is 10:10 AM.

Powered by vBulletin 3.6.8 ©2000 - 2007, content relevant URLs by vBSEO, Property of Core Root.

Content Relevant URLs by vBSEO 3.0.0