Re: scp non root
On Thu, Apr 11, 2013 at 12:04:38PM +0000, Bonno Bloksma wrote:
> I sometimes need to copy some files from the server to my machine and want to
> use scp but… as my default user I do not have access to the files that I just
> have been able to access as root. So I need to:
> - cp the file to the /home/username directory.
> - make sure the filesystem rights are proper for the user to access the
> Then I can scp as the user to the server and get the file. And of course in
> reverse order if I want to place a file on the system.
> Is there a better way or is that the way it needs to be done?
I solved a similar problem by adding:
Host <client machine>
User <valid usernam>
to the /root/.ssh/config file. It allows access to all the files on the
server and copies them with the correct permissions. It only works on
server -> client scp, though. Not the other way around.