Rsync problem
jiten jha
jitenjha11 at googlemail.com
Fri Jul 10 07:45:25 UTC 2009
Dear friend,
I have installed ubuntu 8.04 lts in two new machine and
again i follow some steps.
Source pc >
1> root at jiten-desktop:/root# ssh-keygen -t rsa
2> i get id_rsa.pub and id_rsa both key in /root/.ssh folder.
3> ssh root at 10.0.1.81 address in *destination pc* . login there
4> After that when i use scp command in destination pc to source pc
" scp -r root at 10.0.1.82:/root/.ssh/id_rsa.pub (Source Pc)
root at 10.0.1.81:/root/.ssh/ (Destination Pc)
then it is giving me permision deny error. When i use scp command for
copy.(when i run that command that time i am login in destination pc)
5> When i run scp command source to destination then it works.(With out ssh
)
6> scp -r root at 10.0.1.82:/root/.ssh/id_rsa.pub (source)
root at 10.0.1.81:/root/.ssh
(destinection)
7> chmod 700 id_rsa.pub
8> vim /etc/ssh/sshd_config
9> PermitRootLogin = yes
10> /etc/init.d/ssh restart/reload/start in source pc and Destinetion pc.
11> In a "souce pc" ssh root at 10.0.1.81
Then it is not asking for root password
*AFTER THAT I RUN THAT COMMAND IN (DESTINATION PC)*
12> when i run rsync -r -v -a -e ssh /home/common/Desktop (destination )
root at 10.0.1.82:/home/common/Desktop (Source PC)
(when i copy destination "Desktop" to source "Desktop" ) then i get
that error.
root at common:/home/deepak# rsync -r -v -a -e /home/deepak/Desktop/
root at 10.0.1.82:/common/Desktop
rsync: Failed to exec /home/deepak/Desktop/backup: Permission denied (13)
rsync error: error in IPC code (code 14) at pipe.c(86) [receiver=2.6.9]
rsync: writefd_unbuffered failed to write 4 bytes [receiver]: Broken pipe
(32)
13> when i run rsync -r -v -a -e ssh /home/common/Desktop/java.pdf
(Destination ) root at 10.0.1.81:/home/common/Desktop (Source)
When i run this command as a normal user then it gives following error.
chandan at common:~$ rsync -r -v -a -e ssh /home/chandan/Desktop/test.css
root at 10.0.1.82:/home/common/Desktop
The authenticity of host '10.0.1.82 (10.0.1.82)' can't be established.
RSA key fingerprint is 48:ec:7b:14:8a:7c:28:d1:71:54:67:f7:0f:4c:c7:73.
Are you sure you want to continue connecting (yes/no)? yes
14> When i run this command using root user then it is asking root password.
then it is asking root password.
SAME IN (DESTINATION ) TO (SOURCE)
On Thu, Jul 9, 2009 at 9:18 PM, Preston Kutzner <shizzlecash at gmail.com>wrote:
> jiten jha wrote:
> > Friends,
> > As you told . I follow all steps again but when i run "rsync
> > ssh " command then it is asking root password.
> > Help me to solve that problem .
> >
>
> Do you have "PubkeyAuthentication yes" in your /etc/ssh/sshd_config file
> on your remote host? It should be there by default if you're using
> Ubuntu on it.
>
> Also, just out of curiosity, did you set a password on your ssh key?
> When creating your ssh key it prompts for an *optional* password. If
> you entered one in at the prompts, that might be the password it's
> asking for. If you did provide a password when creating your ssh keys,
> and don't want to use a password with them, you'll have to re-generate
> your keys and just hit 'Return/Enter' at the password prompts. This
> will create a set of keys that don't require a password.
>
> >> In the above steps, you don't indicate which machines you're running
> >> those commands on. It would help us figure out what your problem is if
> >> you provide that information.
> >>
> >> One other possibility that would prevent ssh keys from working when
> >> connecting to a remote host is wrong file/directory permissions on the
> >> remote host. The .ssh directory should have permissions 700 and the
> >> authorized_keys file should be permissions 644, both owned by the
> >> appropriate user.
> >>
> >> You might also have better success following the steps below:
> >>
> >> 1> You can skip steps 1-3 of the original steps you listed if you still
> >> have the keys you generated originally
> >>
> >> 2> You'll want to make sure PermitRemoteLogin = yes is enabled in
> >> /etc/ssh/sshd_config and that you issue a sudo /etc/init.d/ssh restart
> >> on the remote box (if you changed the file) before proceeding to the
> >> next steps.
> >>
> >> 3> Assuming you're copying the id_rsa.pub key from the local machine to
> >> a remote host, you want to use the command: 'scp <path_to>/id_rsa.pub
> >> <user>@<remote_host>:' (In the case you stated above, "scp
> >> <path_to>/id_rsa.pub root at 10.0.0.91:")
> >>
> >> 4> Then, issue the command: ssh root@<remote_host> "if [ -d \".ssh\"];
> >> then cat id_rsa.pub >> .ssh/authorized_keys; else mkdir .ssh; chmod 700
> >> .ssh; cat id_rsa.pub >> .ssh/authorized_keys; fi"
> >>
> >> NOTE QUOTES ABOVE: The above command essentially logs in via ssh, runs
> >> the command(s) in quotes that follow the ssh login command, then closes
> >> the session after the command has completed. Since the command you want
> >> run on the remote server must be in double-quotes on the local host, you
> >> must escape any quotes that will be part of the command run on the
> >> remote host.
> >>
> >> Also, the above command checks for the existence of a .ssh directory in
> >> the user's home, if it exists it then cats out the ssh key to the
> >> authorized_keys file in .ssh (and creates the file if it doesn't exist).
> >> If it does not find a .ssh directory, it creates one, sets the
> >> appropriate permissions, then cats the ssh key out to the
> >> authorized_keys file (again, creating the file if it doesn't exist).
> >>
> >> 5> run the command: rsync -avr -e "ssh -i
> >> <path_to_home_dir>/.ssh/<ssh_key>" /path/on/local/machine
> >> user at host:/path/to/dest
> >>
> >> PLEASE NOTE USE OF QUOTES IN ABOVE STEP, THIS IS IMPORTANT! You can
> >> omit the -i <path_to_home_dir>/.ssh/<ssh_key> portion if using your
> >> user's default ssh key. Otherwise, you must specify the ssh_key if
> >> you're using one different from the user's default. Also, be mindful of
> >> trailing slashes in directory paths, as they do change the behavior of
> >> rsync.
> >>
> >> Those steps should get you to where you need to be. I tried to make
> >> them a little more generalized to be portable to any situation.
> >>
> >> --
> >> ubuntu-users mailing list
> >> ubuntu-users at lists.ubuntu.com
> >> Modify settings or unsubscribe at:
> >> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
> >>
> >
> >
> >
>
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
--
Regards
Jitendra Jha
Jr. Linux System Administrator
Hotwax Media Inc., Indore
+91-9893325765
www.hotwaxmedia.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20090710/488696f8/attachment.html>
More information about the ubuntu-users
mailing list