How can I change my Cygwin home folder after installation?

前端 未结 7 1317
太阳男子
太阳男子 2020-11-30 16:43

I just installed Cygwin, and it looks like the home directory in the bash prompt is on my Z: drive. That\'s not where I want it.

How can I change this?

7条回答
  •  我在风中等你
    2020-11-30 17:22

    I happen to use cwRsync (Cygwin + Rsync for Windows) where cygwin comes bundled, and I couldnt find /etc/passwd.

    And it kept saying

    Could not create directory '/home/username/.ssh'.
    ...
    Failed to add the host to the list of known hosts (/home/username/.ssh/known_hosts).
    

    So I wrote a batch file which changed HOME variable before running rsync. Something like:

    set HOME=.
    rsync /path1 user@host:/path2
    

    And viola! .ssh folder appeared in current working dir and rsync stopped annoying with rsa fingerprints.

    It's a quick hotfix, but later you should change HOME to a more secure location.

提交回复
热议问题