Hello, I''ve got an old fc3 box being retired. I''ve got 5 accounts on the old box i have to move to the new one. This machine is CentOs 4.2. I don''t have the user''s passwords and don''t want to crack the shadow file to get them. So, i went through the old passwd, shadow, and group file, and got out the relevant parts, then i copied those files over to the new box to a tempoary location. Then i did a cat < oldpasswd,shadow,group files to the new files. This worked without a problem. Then i used scp -Cpqr * on /home which got all the data. So far, so good. The problem is permissions were not transfered and i thought that was the point of -p for scp. Did i miss something is there a command i have to use for the new box to pick up the permissions from the old box? Thanks. Dave.
Dave wrote:> good. The problem is permissions were not transfered and i thought that was > the point of -p for scp. Did i miss something is there a command i have to > use for the new box to pick up the permissions from the old box?The -p preserves the date/time and modes, but not the actual UID/GID. Try using rsync with ssh instead, something like: rsync -avz -e ssh --delete /home/ user@host:/home This has the added benefit that if it fails midway (network dies, e.g.) you can just re-run it to start where you left off. Note the trailing slash on the source /home/, that''s important. -te -- Troy Engel | Systems Engineer Fluid, Inc | http://www.fluid.com
On Thu, 2006-03-23 at 11:04, Troy Engel wrote:> > good. The problem is permissions were not transfered and i thought that was > > the point of -p for scp. Did i miss something is there a command i have to > > use for the new box to pick up the permissions from the old box? > > The -p preserves the date/time and modes, but not the actual UID/GID. > Try using rsync with ssh instead, something like: > > rsync -avz -e ssh --delete /home/ user@host:/home > > This has the added benefit that if it fails midway (network dies, e.g.) > you can just re-run it to start where you left off. Note the trailing > slash on the source /home/, that''s important.Or, you can cd to /home before starting and use ''.'' as the source so you don''t have to remember what the trailing / does: cd /home rsync -avz -e ssh --delete . user@host:/home And the -z (compress) is probably only worthwhile on slow connections. -- Les Mikesell lesmikesell@gmail.com