Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 11th January 2007, 07:32
capricorn capricorn is offline
Junior Member
 
Join Date: Jan 2007
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Problems in Automated Backups With rdiff-backup

hi !
I am struggling in configuation of Automated Backups with rdiff-backup. I tried it many times but didnt get any success so thought to ask for problems i am facing.

My server has k12ltsp distribution and the backup server has CentOS.
STEP 1:
K12ltsp Distribution has rdiff-backup-1.0.5-1.fc5 and CentOS distribution has
rdiff-backup-1.0.5-1.el4.rf which i think are same version.

STEP 2:
I have created user as mentioned in step 2.
and then i run command su -m rdiff-backup

[root@localhost ~]# su -m rdiff-backup
bash: /root/.bashrc: Permission denied
bash-3.00$ whoami
rdiff-backup

cd /backup

bash-3.00$ cd /backup/
bash-3.00$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/backup/.ssh/id_rsa):
/backup/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /backup/.ssh/id_rsa.
Your public key has been saved in /backup/.ssh/id_rsa.pub.
The key fingerprint is:
11:97:c7:66:70:e7:61:66:21:e2:91:0c:51:46:73:ca rdiff-backup@localhost.localdomain

NEXT I have created file with contents as following:

bash-3.00$ cat /backup/.ssh/config
host hostname
hostname myipaddress
user root
identityfile /backup/.ssh/id_rsa
compression yes
cipher blowfish
protocol 2

Next i change the permission of that file:

bash-3.00$ chmod -R go-rwx /backup/.ssh
bash-3.00$ ls -l /backup/.ssh
total 16
-rw------- 1 rdiff-backup rdiff-backup 124 Jan 10 22:35 config
-rw------- 1 rdiff-backup rdiff-backup 883 Jan 10 22:33 id_rsa
-rw------- 1 rdiff-backup rdiff-backup 244 Jan 10 22:33 id_rsa.pub
-rw------- 1 rdiff-backup rdiff-backup 395 Jan 10 21:42 known_hosts

When i tried to copy public key to server

bash-3.00$ ssh-copy-id -i ~/.ssh/id_rsa.pub root@host ipaddress
bash: ssh-copy-id: command not found
Then what i did is

bash-3.00$ scp ~/.ssh/id_rsa.pub root@host ipaddress:/public.tmp
root@host ip address's password:
/root/.ssh/id_rsa.pub: Permission denied

Then i login in as root to my backup server n did this:

[root@localhost ~]# scp /backup/.ssh/id_rsa.pub root@host ipaddress:/public.tmp
root@host ipaddress 's password:
id_rsa.pub 100% 244 0.2KB/s 00:00

Then i login to my server and did this:
[root@mainframe]# cat /public.tmp >> /root/.ssh/authorized_keys
root@mainframe]# cat /root/.ssh/authorized_keys
ssh-rsa AAAAB3............................................ .....= rdiff-backup@localhost.localdomain

Then i prepand the text n its in one line
command="rdiff-backup --server --restrict-read-only /",from="ipaddress",no-port-forwarding,no-X11-forwarding,no-pty ssh-rsa AAAAB3............................................ .....= rdiff-backup@localhost.localdomain

[root@mainframe ~]# chmod -R go-rwx /root/.ssh
I have uncomment the two lines in /etc/ssh/sshd_config
[root@mainframe ~]# cat /etc/ssh/sshd_config
RSAAuthentication yes
PubkeyAuthentication yes
[root@mainframe ~]# /etc/init.d/sshd restart
Stopping sshd: [ OK ]
Starting sshd: [ OK ]
[root@mainframe ~]#

STEP 4:
bash-3.00$ whoami
rdiff-backup
bash-3.00$
bash-3.00$ cd /backup/
But it will ask me for password

bash-3.00$ rdiff-backup ipaddress::/boot boot
rdiff-backup@ipaddress's password:

I am sending you all details so that u can figure it out well n tell me why this not working at my end.

Regards.

Last edited by capricorn; 8th March 2007 at 18:44.
Reply With Quote
Sponsored Links
  #2  
Old 12th January 2007, 16:53
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

The problem might be in /root/.ssh/authorized_keys. It could also be caused by two different rdiff-backup versions (I'm not sure if yours are identical).
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 15th January 2007, 06:25
capricorn capricorn is offline
Junior Member
 
Join Date: Jan 2007
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

They are same only distribution is different.
Reply With Quote
  #4  
Old 16th January 2007, 15:03
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

I think they're different. You can only be sure that they are the same if they have identical version numbers and are from the same distribution.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 16th January 2007, 19:26
capricorn capricorn is offline
Junior Member
 
Join Date: Jan 2007
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

well there version number is same i.e 1.0.5 but distribution is different.
rdiff-backup-1.0.5-1.fc5
rdiff-backup-1.0.5-1.el4.rf

U sure we can't configure it on different distributions ?
Is there any howto available to configure rdifs-backup on CentOS as there is ssh-copy-id . Well i have seen ur's n matt posts but i wish i can found this package on CentOS.
Regards.
Reply With Quote
  #6  
Old 5th March 2007, 16:41
capricorn capricorn is offline
Junior Member
 
Join Date: Jan 2007
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Still problem with rdiff-backup

Now i have the same version on fedora.
Backupserver
[root@mainframebkup /]# rpm -q rdiff-backup
rdiff-backup-1.0.5-1.fc5

Mainserver
[root@mainframe ~]# rpm -q rdiff-backup
rdiff-backup-1.0.5-1.fc5

But still im having problem. Plz check me output n tell me wat to do .

Step 2: [root@mainframebkup /]# su -m rdiff-backup
bash: /root/.bashrc: Permission denied


bash-3.1$ cd /backup/


bash-3.1$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/backup/.ssh/id_rsa):
/backup/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /backup/.ssh/id_rsa.
Your public key has been saved in /backup/.ssh/id_rsa.pub.
The key fingerprint is:
29:65:2f:dd:04:82:b1:61:b1:6d:65:14:23:77:40:c8 rdiff-backup@hostname
bash-3.1$

bash-3.1$ cat /backup/.ssh/config
host server_backup
hostname ip address
user root
identityfile /backup/.ssh/id_rsa
compression yes
cipher blowfish
protocol 2

bash-3.1$ chmod -R go-rwx /backup/.ssh

when i follow your step i got error i.e
bash-3.1$ ssh-copy-id -i ~/.ssh/id_rsa.pub root@ipaddress
21
/usr/bin/ssh-copy-id: ERROR: No identities found
( The thing i did here is as follow. I removed ~/.ssh from there.)
bash-3.1$ pwd
/backup/.ssh

bash-3.1$ ssh-copy-id -i id_rsa.pub root@ipaddress
10
root@ipaddress's password:
Now try logging into the machine, with "ssh 'root@ipaddress'", and check in:

.ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.

bash-3.1$

Now on main server.
[root@mainframe ~]# cat /root/.ssh/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAv4ZaUtqxyrAHsU26nrEft8 NAnU3ssdLtvPMqfFeUgm1s4GLMlZmKVGTf1otXFEJ43eT3w9D5 LSuxpvADTyCfg0KL5EGEpabx7mnkHxTAyCws1Pb8o2PIGKTjxM dgBeK4Mq1MO+5kgPKVsQ+T8YcMo08vxUETrkIjdw98/VBceipBhakK+6HJaZJ8xjO5----------------
== rdiff-backup@hostname
step 3; Edit the publick key on main server.(its in one line)
command="rdiff-backup --server --restrict-read-only /",from="ipaddress",no-port-forwarding,no-X11-forwarding,no-pty ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAv4ZaUtqxyrAHsU26nrEft8 NAnU3ssdLtvPMqfFeUgm1s4GLMlZmKVGTf1otXFEJ43eT3w9D5 LSuxpvADTyCfg0KL5EGEpabx7mnkHxTAyCws1Pb8o2--------------------------------------------+NZWM6bXABRnw9NBHtnKFcmc1EpiFp6FhKOKR6KoYZS80C+NRp LZDV9uVDNMjuBHjwUobdpyWSiQ+EzXthxJgtmapMjLrlZqCz4H Q== rdiff-backup@server ip address

Step 4 : testing
bash-3.1$ rdiff-backup server_backup::/boot boot
root@192.168.0.254's password:
it ask me for password

Last edited by capricorn; 8th March 2007 at 18:48.
Reply With Quote
  #7  
Old 5th March 2007, 20:58
Hans Hans is offline
Moderator
 
Join Date: Dec 2005
Location: Montfoort, The Netherlands
Posts: 2,256
Thanks: 212
Thanked 648 Times in 294 Posts
Send a message via Skype™ to Hans
Default

In the past, I had some problems with creating backups by using rdiff as well.
The clue was that i did not use the vi editor, but another called nano which comes with Debian. When i started to use vi, i did not have any problems anymore. Maybe it works also for you.
__________________
Hans

BB-Hosting | Quality Web Hosting since 2005
Reply With Quote
  #8  
Old 6th March 2007, 07:12
capricorn capricorn is offline
Junior Member
 
Join Date: Jan 2007
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have read your post of vi and nano problem but i m using vi on fedora. I also think that i haven't done any thing wrong n checked all things 10 times but still not getting any success.
Reply With Quote
  #9  
Old 6th March 2007, 09:08
Hans Hans is offline
Moderator
 
Join Date: Dec 2005
Location: Montfoort, The Netherlands
Posts: 2,256
Thanks: 212
Thanked 648 Times in 294 Posts
Send a message via Skype™ to Hans
Default

Ok, you do not have nano, but you have vi.
So, i would give it a try.
__________________
Hans

BB-Hosting | Quality Web Hosting since 2005
Reply With Quote
  #10  
Old 6th March 2007, 09:25
capricorn capricorn is offline
Junior Member
 
Join Date: Jan 2007
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

yes i m using vi editor and i have pasted all output . plz check it n give suggestion wat should i do.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Complete automated backup task antoinel12 General 8 10th November 2006 16:22
automated backup pattech General 3 3rd November 2006 11:15
Automated Backups With rdiff-backup Hans Server Operation 44 30th August 2006 16:17
Automated Backups With rdiff-backup comrade_bronski Server Operation 9 7th July 2006 10:11
Automated backup MathieuMa General 1 13th April 2006 08:33


All times are GMT +2. The time now is 14:34.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.