Hi I have installe cygwin and I would like to use rsync but I have this error
Bad owner or permissions on /home/LUPI/.ssh/config
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at
/home/lapo/package/rsync-3.0.9-1/src/rsync-3.0.9/io.c(605) [sender=3.0.9]
I have create the key with this command line and the key
ssh-keygen -t rsa -f ~/.ssh/id_rsa -C "userName"
and the key are similar in the server and in my computer. How to resolve this?
This question should be on superuser or serverfault, and secondly this is an ssh permissions issue and NOT a rsync issue, but here is the solution:
chown -R $USER:users ~/.ssh/
chmod -R 600 ~/.ssh/
Related
I created a gitlab server. when I want to deploy I got this error message:
$ eval $(ssh-agent -s)
Agent pid 258
$ mkdir -p ~/.ssh
$ echo "$SSH_PRIVATE_KEY" >> ~/.ssh/id_dsa
$ chmod 600 ~/.ssh/id_dsa
$ echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
$ rsync -azlh -e 'ssh -p 5432' $CI_PROJECT_DIR/ root#*.**.***.****:/var/www/html/****.com/public_html/
Warning: Permanently added '[*.***.**.***]:5432' (ECDSA) to the list of known hosts.
Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,password).
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(235) [sender=3.1.2]
Cleaning up file based variables
00:01
ERROR: Job failed: exit code 1
my server is ubuntu.
If your GitLab server version is more recent than 11.0 (June 2018), keep in mind that id_dsa ('dsa', not 'rsa') is marked as "deprecated" in "GitLab and SSH keys" documentation:
See "Support for DSA SSH keys"
Due to published weakness in the ssh-dsa algorithm, we’ll wind down support for DSA SSH keys.
In 11.0, the default value for the DSA SSH keys setting is “Are forbidden”. This setting is located in the visibility and access controls section of the Settings admin panel.
This setting may be overridden if desired.
Beginning in 12.0, GitLab will always reject DSA SSH keys.
Planned removal date: June 22, 2018
It is best to create keys like:
ssh-keygen -t ed25519 -C "<comment>"
# or
ssh-keygen -t rsa -b 2048 -C "<comment>"
I am trying to get scp to work and transfer a file from a remote server to my local. I tried looking around and this post helped the most but it still is not working here is the current output.
<HOSTNAME>:chef4-rep
<USERNAME>$ sudo scp -i ./.chef/<NAME>.pem <USERNAME>#<IP>:/home/postgres/post_0604_dump/db0604_schema_and_data.sql ~/
<USERNAME>#<IP>: Permission denied (publickey).
The issue turned out not to be with my command but that I was trying to copy a file in another users directory and it wouldn't work. I ended up SSH'ing in and using sudo to copy the file to my home directory and then used scp with no issues.
Kindly use below command to get it done.
root#localhost# scp -r "source_file/directory" "Destination address- remote-IP/Hostname:/location"
And if you are using passwordless ssh then make sure you are using correct user whose public keys are shared with remote server.
Thanks
I had the same issue with scp and got Permission denied (publickey):
This worked:
ssh -i "mykey.pem" ubuntu#??.??.??.???
But this didn't: scp -i "mykey.pem" test.php ubuntu#??.??.??.???:
I solved it by removing the quotes off my key file:
scp -i mykey.pem test.php ubuntu#??.??.??.???:
I installer Vagrant 1.8.1 on Windows 10 and as well cygwin and cwRsync. Now i get this error when do vagrant up:
There was an error when attempting to rsync a synced folder.
Please inspect the error message below for more info.
Host path: /cygdrive/m/development/Projects/www.webapp.local/
Guest path: /vagrant
Command: rsync --verbose --archive --delete -z --copy-links --chmod=ugo=rwX --no-perms --no-owner --no-group --rsync-path sudo rsync -e ssh -p 2222 -o ControlMaster=auto -o ControlPath=C:/Users/Eric/AppData/Local/Temp/ssh.202 -o ControlPersist=10m -o StrictHostKeyChecking=no -o IdentitiesOnly=true -o UserKnownHostsFile=/dev/null -i 'M:/development/Projects/www.webapp.local/.vagrant/machines/default/virtualbox/private_key' --exclude .vagrant/ /cygdrive/m/development/Projects/www.webapp.local/ vagrant#127.0.0.1:/vagrant
Error: Could not create directory '/home/Eric/.ssh'.
Warning: Permanently added '[127.0.0.1]:2222' (ECDSA) to the list of known hosts.
mm_receive_fd: no message header
process_mux_new_session: failed to receive fd 0 from slave
mux_client_request_session: read from master failed: Connection reset by peer
Failed to connect to new control master
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.2]
I already tried the suggestions in this post: http://ekawas.blogspot.co.uk/2007/03/solving-pesky-ssh-issues-in-cygwin.html
But no success.
For now I tried to use another Debian 8 box and it suprised me that this box works in one time without the need to install rsync and cygwin seperate, like the way how Vagrant has to work in my opinion: install and setup without hassle. Also syncing the /vagrant folder works in both directions.
I really don't understand why some boxes need the hassle with installing rsync and cygwin and doing hacks in Vagrant files and other boxes just work with the basic setup of Vagrant.
Well I'm not a Vagrant expert, so maybe I miss something in this way? Maybe someone can explain?
This seems to be a known issue with Vagrant >=1.8.0 and Windows hosts.
For the ones still struggling, remove the following code in $VAGRANT_HOME\embedded\gems\gems\vagrant-1.8.0\plugins\synced_folders\rsync\helper.rb (lines 77 to 79):
"-o ControlMaster=auto " +
"-o ControlPath=#{controlpath} " +
"-o ControlPersist=10m " +
Source
I gonna backup some files from a local machine to a remote server trough rsync over ssh. Here is the command I used:
rsync -avh -e "ssh -p 3286" somelocal_folder/ me#x.x.x.x:/data/bu/
The user(me) which I use to ssh to the server has rwx permissions on /data/bu directory but it does not have write permission on /data. It raises permission denied error when I enter my password. I searched a lot in the Internet,but I could not find any thing relevant. Any idea of the cause of the problem?!!
I'm new to rsync, so my problem is probably obvious.
I'm trying to backup the folders in Windows Pictures to a remote Linux directory.
This is what I have:
rsync -av ssh /cygdrive/c/users/Owner/Pictures blah#192.168.1.10:/var/files/ImageSync
I got this format from: Transferring from Windows to Linux with rsync
But I am getting this error:
rsync: link_stat "/home/Owner/ssh" failed: No such file or directory (2)
rsync: change_dir "/cygdrive/c/users/Owner/Pictures" failed: No such file or directory (2)
sent 20 bytes received 12 bytes 64.00 bytes/sec
total size is 0 speedup is 0.00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1165) [sender=3.1.1]
I have an ssh key pair already linked up, so there is no need for a password... Unless I did something wrong and that's why I am having issues.
Thanks!
Note:
Had to manually open cygdrive through cd and ls. It works!
rsync -av -e ssh /cygdrive/c/Users/Owner/Pictures/ blahc#192.168.1.10:/var/files/ImageSync/
I think you may need a "-e" ahead of ssh:
rsync -av -e ssh /cygdrive/c/users/Owner/Pictures blah#192.168.1.10:/var/files/ImageSync