Cygwin sshd问题


1

Cygwin的一个很酷的功能就是能够 cd 进入同一网络上的远程Windows机器:

[0 user@machine ~]$ cd //remote-machine/c$
[0 user@machine //remote-machine/c$]$ ls
Program Files/
Program Files (x86)/
ProgramData/
Users/
Windows/

这使我能够非常快速地完成与我的工作相关的许多事情,而无需使用Windows远程桌面进行连接。

但是,有时候我会在家工作,而且我会进入我的工作机器。从那里,我希望能够 cd 以相同的方式对这些相同的机器,但我不能这样做:

[0 user@machine ~]$ cd //remote-machine/c$
-bash: cd: //remote-machine/c$: Permission denied

我怀疑它与Cygwin sshd在通过ssh连接时如何处理用户有关。但是,我知道这是可能的,因为我有一个能够做到这一点的同事。不幸的是,他不记得他在sshd设置中是否做了什么特别的事情。

这是我的输出 ssh-host-config 在我的设置期间(以管理员身份启动Cygwin mintty)。

[0 user@machine ~]$ ssh-host-config

*** Info: Generating missing SSH host keys
*** Info: Creating default /etc/ssh_config file
*** Info: Creating default /etc/sshd_config file

*** Info: StrictModes is set to 'yes' by default.
*** Info: This is the recommended setting, but it requires that the POSIX
*** Info: permissions of the user's home directory, the user's .ssh
*** Info: directory, and the user's ssh key files are tight so that
*** Info: only the user has write permissions.
*** Info: On the other hand, StrictModes don't work well with default
*** Info: Windows permissions of a home directory mounted with the
*** Info: 'noacl' option, and they don't work at all if the home
*** Info: directory is on a FAT or FAT32 partition.
*** Query: Should StrictModes be used? (yes/no) yes

*** Info: Privilege separation is set to 'sandbox' by default since
*** Info: OpenSSH 6.1.  This is unsupported by Cygwin and has to be set
*** Info: to 'yes' or 'no'.
*** Info: However, using privilege separation requires a non-privileged account
*** Info: called 'sshd'.
*** Info: For more info on privilege separation read /usr/share/doc/openssh/README.privsep.
*** Query: Should privilege separation be used? (yes/no) yes
*** Info: Note that creating a new user requires that the current account have
*** Info: Administrator privileges.  Should this script attempt to create a
*** Query: new local account 'sshd'? (yes/no) yes
*** Info: Updating /etc/sshd_config file

*** Query: Do you want to install sshd as a service?
*** Query: (Say "no" if it is already installed as a service) (yes/no) yes
*** Query: Enter the value of CYGWIN for the daemon: [] ntsec
*** Info: On Windows Server 2003, Windows Vista, and above, the
*** Info: SYSTEM account cannot setuid to other users -- a capability
*** Info: sshd requires.  You need to have or to create a privileged
*** Info: account.  This script will help you do so.

*** Info: It's not possible to use the LocalSystem account for services
*** Info: that can change the user id without an explicit password
*** Info: (such as passwordless logins [e.g. public key authentication]
*** Info: via sshd) when having to create the user token from scratch.
*** Info: For more information on this requirement, see
*** Info: https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-nopasswd1

*** Info: If you want to enable that functionality, it's required to create
*** Info: a new account with special privileges (unless such an account
*** Info: already exists). This account is then used to run these special
*** Info: servers.

*** Info: Note that creating a new user requires that the current account
*** Info: have Administrator privileges itself.

*** Info: No privileged account could be found.

*** Info: This script plans to use 'cyg_server'.
*** Info: 'cyg_server' will only be used by registered services.
*** Query: Do you want to use a different name? (yes/no) no
*** Query: Create new privileged user account 'MACHINE\cyg_server' (Cygwin name: 'machine+cyg_server')? (ye                                                                                                                    s/no) yes
*** Info: Please enter a password for new user machine+cyg_server.  Please be sure
*** Info: that this password matches the password rules given on your system.
*** Info: Entering no password will exit the configuration.
*** Query: Please enter the password:
*** Query: Reenter:

*** Info: User 'machine+cyg_server' has been created with password ''.
*** Info: If you change the password, please remember also to change the
*** Info: password for the installed services which use (or will soon use)
*** Info: the 'machine+cyg_server' account.


*** Info: The sshd service has been installed under the 'machine+cyg_server'
*** Info: account.  To start the service now, call `net start sshd' or
*** Info: `cygrunsrv -S sshd'.  Otherwise, it will start automatically
*** Info: after the next reboot.

*** Info: Host configuration finished. Have fun!

其他可能相关的信息:

  1. 我的用户名是我工作域中的域用户
  2. 运行sshd的机器是Windows 8.1 Enterprise
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.