View the Most Wanted LQ Wiki articles.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-17-2005, 11:06 AM   #1
Registered: Dec 2004
Location: Petaluma, CA
Distribution: Centos 4 and RH 9
Posts: 47

Rep: Reputation: 15
Keeping ownership of files

When I do

scp -rp *

I lose the ownerships; they become "root". How can I keep the ownership?

Old 07-17-2005, 01:47 PM   #2
Registered: Aug 2004
Posts: 107

Rep: Reputation: 15
i am not familiar with that command, however if you do cp --help it brings up the options, one of which is keep the ownerships etc. as they are. if that doesn't help then the only other option is to go in as root and chown -R [user] [directory] this will recurse down the tree changing all files from the specified directory onwards to the specified user.
Old 07-17-2005, 04:14 PM   #3
Senior Member
Registered: Oct 2004
Posts: 1,192

Rep: Reputation: 101Reputation: 101
I had a quick look at the man page for scp and there doesn't seem to be a option to preserve owner and group, the file will be owned by whoever you log into as.

Logging into a machine remotely using root isn't the best of ideas anyway.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
changing permissions and ownership on many files and folders Cinematography Linux - General 4 08-01-2005 03:20 AM
sudo: How can i change the ownership of particular files? anoopp Linux - Security 1 03-18-2005 02:03 AM
changing ownership and group of multiple files.. utanja Debian 3 02-21-2005 06:10 PM
Ownership of new Files in SAMBA ghight Linux - Software 6 02-06-2003 10:40 AM
ownership of files changed after upgrade Tinkster Slackware 1 12-20-2002 07:34 PM

All times are GMT -5. The time now is 07:18 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration