Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


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

Rep: Reputation: 0
Question About Resync Command


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

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,

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

Rep: Reputation: 1224Reputation: 1224Reputation: 1224Reputation: 1224Reputation: 1224Reputation: 1224Reputation: 1224Reputation: 1224Reputation: 1224
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.


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 01:57 PM
Resync mysql dlublink Linux - Software 1 06-21-2006 11:37 AM
resync in Partitionable RAID 5. FinalFantasy Linux - General 4 10-15-2005 10:02 AM
RAID resync thedeud Linux - General 6 03-14-2003 06:22 PM
Resync every reboot u4113072 Linux - Software 0 10-15-2002 03:06 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:19 AM.

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