windows-7 - Cygwin SSH 的目录权限 (Windows 7)

标签 windows-7 permissions ssh cygwin openssh

我是 Linux 的粉丝,但由于 Linux 中的 Intel 无线驱动程序很糟糕,我不得不切换到 Windows 7。我已经在 Windows 中安装了 Cygwin,并且想要配置 SSH 来远程连接到我的笔记本电脑。

我用Google搜索并发现information for installing openssh server on Win 7 ,但在运行 ssh-host-config 时出现以下错误:

bala@bala-PC ~
$ ssh-host-config
yes
*** Info: Creating default /etc/ssh_config file
*** Query: Overwrite existing /etc/sshd_config file? (yes/no) yes
*** Info: Creating default /etc/sshd_config file
*** Info: Privilege separation is set to yes by default since OpenSSH 3.3.
*** Info: However, this requires a non-privileged account called 'sshd'.
*** Info: For more info on privilege separation read /usr/share/doc/openssh/READ
ME.privsep.
*** Query: Should privilege separation be used? (yes/no) no
*** Info: Updating /etc/sshd_config file

*** Warning: The following functions require administrator privileges!

*** 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: []
*** 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.

*** Warning: The owner and the Administrators need
*** Warning: to have .w. permission to /var/run.
*** Warning: Here are the current permissions and ACLS:
*** Warning:     drwxr-xr-x 1 bala None 0 2010-01-17 22:34 /var/run
*** Warning:     # file: /var/run
*** Warning:     # owner: bala
*** Warning:     # group: None
*** Warning:     user::rwx
*** Warning:     group::r-x
*** Warning:     other:r-x
*** Warning:     mask:rwx
*** Warning:
*** Warning: Please change the user and/or group ownership,
*** Warning: permissions, or ACLs of /var/run.

*** ERROR: Problem with /var/run directory. Exiting.

此文件夹的权限显示为只读(仅适用于此文件夹),以灰色选中。我尝试取消选中,但再次打开属性后,该框再次被选中。有没有办法更改此文件夹的权限?

最佳答案

很抱歉要揭开这样一个旧线程,但是当我用谷歌搜索这个特定问题时,这个问题总是出现。

几个月后,我终于找到了解决办法。当我设置 cygwin 时,我没有在 cygwin 中正确创建我的用户和组帐户。执行此操作的主要方法是运行:

mkpasswd -l > /etc/passwd
mkgroup -l > /etc/group

如果您使用域用户和密码登录,您可以执行以下操作:

mkpasswd -l -d > /etc/passwd 
mkgroup -l -d > /etc/group

或者,如果您拥有像我一样庞大的网络,您可能并不真正想要这样。另一种方法是仅使用您的本地用户和组以及您当前登录的任何用户:

mkpasswd -l > /etc/passwd
mkpasswd -c >> /etc/passwd
mkgroup -l > /etc/group
mkgroup -c >> /etc/group

完成此操作后,我终于能够正确运行 ssh-host-config 来创建服务。

关于windows-7 - Cygwin SSH 的目录权限 (Windows 7),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2159706/

相关文章:

perl - @ARGV 在 Windows 7 中使用 ActivePerl 为空

windows-7 - 批量/CMD move 不适用于文件夹

wordpress无法安装插件,用chown解决但无法FTP

postgresql - 无法在 Ubuntu 上建立 Postgres pgAdmin SSH 隧道

c# - 振作起来

asp.net - 在使用 Windows Auth 的 Windows 7 上使用 VS 2008 的调试 Web 服务器时,User.IsInRole 失败

Android AsyncTask 中的 onRequestPermissionsResult

kubernetes - 如何在 Kubernetes 中查找绑定(bind)到服务帐户的角色或集群角色?

git - 无法在 ssh 终端 session 中推送到 github(Ubuntu ssh-agent over ssh)

python - Python 守护进程中的 Paramiko 导致 IOError