Windows 7 Cygwin SSH(Windows 7)的目录权限
我是Linux的粉丝,但由于Linux中糟糕的英特尔无线驱动程序,我不得不切换到Windows7。我已经在Windows中安装了Cygwin,希望将SSH配置为远程连接到我的笔记本电脑 我用Google搜索并找到了,但在运行Windows 7 Cygwin SSH(Windows 7)的目录权限,windows-7,permissions,ssh,cygwin,openssh,Windows 7,Permissions,Ssh,Cygwin,Openssh,我是Linux的粉丝,但由于Linux中糟糕的英特尔无线驱动程序,我不得不切换到Windows7。我已经在Windows中安装了Cygwin,希望将SSH配置为远程连接到我的笔记本电脑 我用Google搜索并找到了,但在运行ssh-host-config时出现以下错误: bala@bala-PC ~ $ ssh-host-config yes *** Info: Creating default /etc/ssh_config file *** Query: Overwrite existing
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.
bala@bala-个人电脑~
$ssh主机配置
对
***信息:创建默认的/etc/ssh\u配置文件
***查询:是否覆盖现有的/etc/sshd\u配置文件?(是/否)是
***信息:创建默认的/etc/sshd\u配置文件
***信息:自OpenSSH 3.3以来,特权分离默认设置为“是”。
***信息:但是,这需要一个名为“sshd”的非特权帐户。
***信息:有关特权分离的更多信息,请阅读/usr/share/doc/openssh/read
我是普列维塞普。
***问题:应该使用特权分离吗?(是/否)否
***信息:正在更新/etc/sshd\u配置文件
***警告:以下功能需要管理员权限!
***查询:是否要将sshd作为服务安装?
***查询:(如果已作为服务安装,请说“否”)(是/否)是
***查询:输入守护程序的CYGWIN值:[]
***信息:在Windows Server 2003、Windows Vista及更高版本上
***信息:系统帐户无法将UID设置为其他用户--这是一种功能
***信息:sshd需要。您需要拥有或创建特权
***信息:帐户。此脚本将帮助您执行此操作。
***警告:所有者和管理员需要
***警告:有。对/var/run的权限。
***警告:以下是当前权限和ACL:
***警告:drwxr-xr-x 1巴拉无0 2010-01-17 22:34/var/run
***警告:#文件:/var/run
***警告:#所有者:巴拉
***警告:#组:无
***警告:用户::rwx
***警告:组::r-x
***警告:其他:r-x
***警告:掩码:rwx
***警告:
***警告:请更改用户和/或组所有权,
***警告:/var/run的权限或ACL。
***错误:/var/run目录有问题。退出。
此文件夹的权限显示为只读(仅适用于此文件夹),以灰色选中。我试图取消选中,但在再次打开属性后,该框再次被选中。有没有办法更改此文件夹的权限?我正在Windows 7 x64和sshd上运行cygwin 1.7。我不记得在运行sshd_config时遇到过这个错误,但我只是查看了我的/var/run目录,它被设置为777
在cygwin外壳中尝试此操作,然后确保您是管理员:
takeown/F“C:\cygwin”/R
icacls“C:\cygwin”/授予所有人:\(F\)/T
icacls“C:\cygwin”
chmod 777-R“c:\cygwin”
很抱歉,我解开了这么一条旧的线索,但当我在谷歌上搜索这个特定问题时,总是会出现这个问题
几个月后,我终于找到了解决办法。当我设置cygwin时,我没有在cygwin中正确创建我的用户和组帐户。执行此操作的主要方法是运行:
mkpasswd -l > /etc/passwd
mkgroup -l > /etc/group
如果您使用域用户和passwd登录,则可以执行以下操作:
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主机配置来创建服务。我自己也遇到了很多麻烦。我发现默认安装步骤工作正常,前提是:
以下是Cygwin卸载说明(如果需要):我只有在NTFS类型的硬盘上安装Cygwin时才能成功运行ssh主机配置脚本。当我在exFAT类型的闪存驱动器上安装Cygwin时,ssh主机配置脚本不起作用。我也遇到了同样的问题。我相信,我的问题是因为我有一个自定义的/etc/fstab文件,在其中我使用“noacl”选项挂载根文件夹。下面是我如何解决这个问题的:
mv /etc/fstab /etc/fstab.bak
或者,您可以编辑/etc/fstab文件并删除noacl选项chmod +r /etc/passwd
chmod o+x /var
chmod +w /var/run
mv /etc/fstab.bak /etc/fstab
mkpasswd -l > /etc/passwd
我首先必须移除损坏的安装:
cygrunsrv --remove sshd
rm -rf /var/log/sshd* /etc/ssh_host* /etc/sshd_config /var/empty
然后生成如上所述的passwd&group:
mkpasswd -l > /etc/passwd
mkgroup -l > /etc/group
ssh-host-config -y
cygrunsrv --start sshd