Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSH cannot see files copied using 'cp' from windows #108

Closed
Codemaverick opened this issue Apr 10, 2016 · 2 comments
Closed

SSH cannot see files copied using 'cp' from windows #108

Codemaverick opened this issue Apr 10, 2016 · 2 comments

Comments

@Codemaverick
Copy link

I made the title as specific as possible because I know there are already a few issues (#44) and (#45) relating to bash seeing files copied using explorer into the Ubuntu file system (AppData/lxss).

I ran into that issue, and then decided to copy over some of my previous ssh keys using 'cp' from inside bash. Still, when I attempt to load they keys into the ssh-agent, it tells me the file does not exist even though they show up using the 'ls' command.

@russalex
Copy link
Contributor

Thank you for making the title specific.

Here's what I normally do (and what always works for me). Please tell me what you're doing different.

Setup:

  • Windows: ssh keys under /mnt/c/users/russalex/.ssh/ (russ_rsa and russ_rsa.pub)
  • Bash: Want keys under ~/.ssh/
    Commands
russ@RUSSALEX-DESK:~$ mkdir ~/.ssh
russ@RUSSALEX-DESK:~$ cd ~/.ssh
russ@RUSSALEX-DESK:~/.ssh$ cp /mnt/c/users/russalex/.ssh/russ* .
russ@RUSSALEX-DESK:~/.ssh$ eval $(ssh-agent)
Agent pid 306
russ@RUSSALEX-DESK:~/.ssh$ ls
russ_rsa  russ_rsa.pub
russ@RUSSALEX-DESK:~/.ssh$ chmod 600 russ_rsa
russ@RUSSALEX-DESK:~/.ssh$ ssh-add russ_rsa
Identity added: russ_rsa (russ_rsa)
russ@RUSSALEX-DESK:~/.ssh$

Now, if you do not run the chmod command you'll get:

russ@RUSSALEX-DESK:~/.ssh$ ssh-add russ_rsa
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0777 for 'russ_rsa' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.

Is this what you're doing? If not, any chance you could list out the commands you're running?

@benhillis
Copy link
Member

Closing this thread out since there hasn't been activity since 4/11. If you are continuing to have issues please reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants