LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 11-12-2009, 10:58 AM   #1
Un!x85
LQ Newbie
 
Registered: Oct 2009
Posts: 4

Rep: Reputation: 0
Question About Resync Command


hi

i want to resync folder from server to another automaticly with the following command :

Code:
rsync -arzgopu -e "ssh -p 1111" /backups/cpbackup/daily user@ip:/backup
but reqire password , that made it manually

i want some help about it and to find a way to make a bash script or someting transfer with password included automaticlly not wrote it .

i will be appreicated,
thanks

Last edited by Un!x85; 11-12-2009 at 11:02 AM.
 
Old 11-12-2009, 11:12 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Rather than storing the password which is a security risk you might want to think about setting up an ssh trust. This allows the login to occur without a password based on ssh keys.

Basic steps are:
1) Run ssh-keygen as the source user on the source host to create a public and private key pair. (Type "man ssh-keygen" to see options.)

2) Copy the the public key created (typically in $HOME/.ssh directory of the source user) into authorized_keys files of the target user on the target host (again in $HOME/.ssh directory).

Once you do that you can test by simply doing "ssh targetuser@targethost. If it works you'll have a shell prompt there.

Note a couple of gotchas. The home directory for each host should be writable only by the user that owns it (it can be read/execute for everyone but not writable by anyone by user). The $HOME/.ssh should only be read write for the user that owns it. No one else should be able to read or write it. If thse conditions aren't met it won't be considered "trusted" and won't work.
 
  


Reply


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
Can't stop mdadm resync! mackdav Linux - Server 3 03-27-2007 12:57 PM
Resync mysql dlublink Linux - Software 1 06-21-2006 10:37 AM
resync in Partitionable RAID 5. FinalFantasy Linux - General 4 10-15-2005 09:02 AM
RAID resync thedeud Linux - General 6 03-14-2003 05:22 PM
Resync every reboot u4113072 Linux - Software 0 10-15-2002 02:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:52 AM.

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