UNIX & Linux Forums

UNIX & Linux Forums (https://www.unix.com/index.php)
-   Red Hat (https://www.unix.com/red-hat/)
-   -   scp with su (https://www.unix.com/red-hat/140421-scp-su.html)

arumon 07-16-2010 07:34 AM

scp with su
Hi Friends,

I am trying to copy some files over the network in between my linux servers. I am using scp command for this. by default direct ssh root login is disabled on all of my linux servers. Normaly we used to login as a normal user and the su to th root user.
unfortunately root user is only having the write permission. Is there any alternative option on scp command to switch to root user before starting the copying. Please help me.


Corona688 07-17-2010 01:35 AM

If root login is disabled, then root login is disabled. You'll need to enable root login to enable root login.

There are other ways this could be done than scp, though. You could tunnel a tape archive into ssh, fed into tar or a script that runs tar as root via sudo. something like


tar -cf - dir1/ dir2/ file1 file2 | ssh user@host sudo tar -C remote/destination/ -xf -
Any root access is dangerous, of course. Nothing prevents you from wiping out vital system files, and if this process is exploited they will easily gain full control of the system.

All times are GMT -4. The time now is 03:26 AM.

UNIX and Linux Forums
Search Engine Optimisation provided by DragonByte SEO v2.0.32 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Unix & Linux Forums Content Copyright©1993-2017. All Rights Reserved.
Forum Operations by The UNIX and Linux Forums