5

I am using cygwin and I am trying to set up an .ssh/config file. Cygwin's folder is in my C: drive. My Home directory is C:\Users\USER. I have noticed that when I edit C:\Users\USER.ssh\config, cygwin does not even notice it (even though it notices the other files I have in my USER folder, i.e. .bashrc). But it does notice the config file if I put it in C:\cygwin64\home\USER.ssh\config.

Is there a way to get cygwin to read the .ssh folder in my USER home directory instead?

fusilli.jerry89
  • 309
  • 3
  • 11
  • Are you sure you have package openssh installed? Perhabs, you are using windows ssh.exe – Juan Apr 24 '20 at 05:51
  • modern answer: `db_home: /%H` in `/etc/nsswitch.conf` See https://stackoverflow.com/questions/28573763/i-am-unable-to-find-the-etc-passwd-file-in-cygwin for more – Liviu Dec 14 '22 at 20:24

2 Answers2

7

Make sure your home directory setup in /etc/passwd matches /home/ Often it is not set at all (second to last field in the ':' delimited line. Then you'll need to restart your cygwin session (exit the terminal, and restart)

That should fix your problem.

jvarsoke
  • 86
  • 1
  • 2
1

This isn't the greatest solution but it works:

ln -s /cygdrive/c/Users/username/.ssh /home/username/.ssh

If /home/username/.ssh already exists, perhaps rename it to .ssh_original or move the files into the other .ssh folder.

Curtis Yallop
  • 6,696
  • 3
  • 46
  • 36