Please note the new address for this forum : forum.excito.org. The old address redirects here but I don't know for how long. Thanks !
New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

RSync Backup Problems

Got problems with your B2 or B3? Share and get helped!
jovisuk
Posts: 65
Joined: 12 Sep 2010, 04:20

Re: RSync Backup Problems

Post by jovisuk »

I'm on MSN, email address is:

Thanks,
Last edited by jovisuk on 04 Nov 2010, 11:50, edited 1 time in total.
Ubi
Posts: 1549
Joined: 17 Jul 2007, 09:01

Re: RSync Backup Problems

Post by Ubi »

the problem is the format of your private key. Is it an RSA1 key?

Code: Select all

debug3: Not a RSA1 key file /home/backup-user/cron/backup-bubba-rsync-key.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
Ubi
Posts: 1549
Joined: 17 Jul 2007, 09:01

Re: RSync Backup Problems

Post by Ubi »

ok, you may want to encrypt that email adres there considering this is a public forum
jovisuk
Posts: 65
Joined: 12 Sep 2010, 04:20

Re: RSync Backup Problems

Post by jovisuk »

I simply followed the instructions in the guide which were:

ssh-keygen -t dsa -b 1024 -f /home/backup-user/cron/backup-Bubba-rsync-key

Is there a command I can do to create a proper key so that then once I copy that key to the authorized_keys folder it works?
jovisuk
Posts: 65
Joined: 12 Sep 2010, 04:20

Re: RSync Backup Problems

Post by jovisuk »

Good call, forgot this was public
Ubi
Posts: 1549
Joined: 17 Jul 2007, 09:01

Re: RSync Backup Problems

Post by Ubi »

ah and also chmod-ing the permissions on the dirs that contain the keys you are using to 700 may help
Ubi
Posts: 1549
Joined: 17 Jul 2007, 09:01

Re: RSync Backup Problems

Post by Ubi »

change the keygen command to "-t RSA" to see what happens
*make sure the privat key file, and the dir containing that file, are only readable by yourself
jovisuk
Posts: 65
Joined: 12 Sep 2010, 04:20

Re: RSync Backup Problems

Post by jovisuk »

I changed it to RSA but still no joy.

When you say make sure the private key and dir are only readable by myself, which user do you mean? the backup-user or the main-user? on which unit?
Ubi
Posts: 1549
Joined: 17 Jul 2007, 09:01

Re: RSync Backup Problems

Post by Ubi »

the private key and its container should in principal only be readable by the user thats using that key. changing it with chmod 600 should do the trick.

did you read the auth.log on the receiving unit to see it it gives a clue?


On a side note you're not the only one with this problem:
http://ubuntuforums.org/showthread.php?t=541339
http://www.google.nl/search?client=oper ... 8&oe=utf-8
jovisuk
Posts: 65
Joined: 12 Sep 2010, 04:20

Re: RSync Backup Problems

Post by jovisuk »

Forgive my ignorance, to do this, would I navigate to the directory/file and then:

chmod 600 directory

then go into the directory and:

chmod 600 filename
jovisuk
Posts: 65
Joined: 12 Sep 2010, 04:20

Re: RSync Backup Problems

Post by jovisuk »

Dug through the auth.log and found this:

Nov 4 11:54:28 main-bubba sshd[1995]: Authentication refused: bad ownership or modes for file /home/main-user/.ssh/authorized_keys
Cheeseboy
Posts: 789
Joined: 08 Apr 2007, 12:16

Re: RSync Backup Problems

Post by Cheeseboy »

Hi guys,

I can add from own experience that the wrong permissions on the .ssh directory itself will also make it fail.
Should look like this:

Code: Select all

niklas@b3:~$ ls -ld .ssh
drwx------ 2 niklas users 4096 Nov  1 10:01 .ssh
If it is the permissions that are making it fail, you should see it in the /var/log/auth.log on the machine you are trying to connect to:

Code: Select all

bubba2:/home/test# tail /var/log/auth.log
...
Nov  5 20:14:10 bubba2 sshd[6274]: Authentication refused: bad ownership or modes for directory /home/test/.ssh
Cheers,

Cheeseboy
jovisuk
Posts: 65
Joined: 12 Sep 2010, 04:20

Re: RSync Backup Problems

Post by jovisuk »

Hi Cheeseboy,

The error you posted is almost identical to what I find in my auth.log file.

How do I apply the correct permissions to the .ssh directory on my target unit?

Thanks in advance for your help!!
Cheeseboy
Posts: 789
Joined: 08 Apr 2007, 12:16

Re: RSync Backup Problems

Post by Cheeseboy »

Code: Select all

niklas@bubba2:/$ cd ~
niklas@bubba2:~$ chmod 700 .ssh
niklas@bubba2:~$ ls -ld .ssh
drwx------ 2 niklas users 4096 2010-10-20 14:34 .ssh
jovisuk
Posts: 65
Joined: 12 Sep 2010, 04:20

Re: RSync Backup Problems

Post by jovisuk »

Cheeseboy that worked a treat! Thank you and Ubi!!

For future reference, to resolve this I did as Ubi suggested, and used an RSA keygen:

Code: Select all

ssh-keygen -t rsa -b 1024 -f /home/backup-user/cron/YOURBUBBAHOSTNAME-rsync-key
Then as Cheeseboy suggested, I changed the permissions on the .ssh directory:

Code: Select all

chmod 700 .ssh
Thanks for everyone's help!
Post Reply