Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 74585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:22:52+00:00 2026-05-10T20:22:52+00:00

I want to set up an automatic rsync job to backup a bunch of

  • 0

I want to set up an automatic rsync job to backup a bunch of user accounts on my OS X machine to a linux fileserver. I have set up password-free ssh from my account to another machine, and it works great, so I tried using this command:

sudo rsync -avz /Users/jbloggs myserv:/var/Backup/ 

where myserv is an alias set up in my ~/.ssh/config. The problem I have is that I have to use sudo to get that command to work — under my personal account I don’t have access to the other users’ home directories to copy files for backup. That command works fine on my own account without sudo, but when I run under sudo it’s not looking at my ~/.ssh/config any more (so it complains about ‘unknown host myserv’).

How can I get the rsync running under sudo to still look at my personal ~/.ssh/config?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T20:22:53+00:00Added an answer on May 10, 2026 at 8:22 pm

    You can use

    ssh -i /Users/myuser/.ssh/id_rsa -F /Users/myuser/.ssh/config login@host 

    to let ssh use your config / key files. Use ‘-v’ to check which file it is using. You could also copy your configuration / id to /var/root/.ssh, which will be used by default when using ssh via sudo.

    To pass these options to rsync, you have to set the ‘–rsh’ / ‘-e’ like this:

    rsync -e 'ssh -i ... -F ...' 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 78k
  • Answers 78k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Personally, I'd probably leave the EmployeeStatus codes in the DB… May 11, 2026 at 3:37 pm
  • added an answer How much time per week should the product owner (if… May 11, 2026 at 3:37 pm
  • added an answer Your example updated and working. I don't know what you… May 11, 2026 at 3:37 pm

Related Questions

I've been working on a web app using Django, and I'm curious if there
Currently I have subversion set up so that when I make changes in Eclipse
I often find I want to write code something like this in C#, but
I have a pair of SQL Servers at different webhosts, and I'm looking for

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.