Cygwin SSH 的目录权限 (Windows 7)
我是 Linux 的粉丝,但由于 Linux 中的 Intel 无线驱动程序很糟糕,我不得不切换到 Windows 7。我已经在 Windows 中安装了 Cygwin,并且想要配置 SSH 来远程连接到我的笔记本电脑。
我用Google搜索并找到安装信息Win 7 上的 openssh 服务器,但运行 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.
此文件夹的权限显示为只读(仅适用于此文件夹) ,以灰色选中。我尝试取消选中,但再次打开属性后,该框再次被选中。有没有办法改变这个文件夹的权限?
I am a fan of Linux but due to bad Intel wireless drivers in Linux, I had to switch to Windows 7. I have installed Cygwin in Windows and want to configure SSH to remotely connect to my laptop.
I searched with Google and found information for installing openssh server on Win 7, but I am getting the following error when running 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.
The permissions of this folder are shown as read-only (only applies to this folder), checked in gray. I tried to uncheck but after I open the properties again, the box is again checked. Is there a way to change the permissions of this folder?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
很抱歉揭开这样一个旧线程,但是当我用谷歌搜索这个特定问题时,这个问题总是出现。
几个月后,我终于找到了解决办法。当我设置 cygwin 时,我没有在 cygwin 中正确创建我的用户和组帐户。执行此操作的主要方法是运行:
如果您使用域用户和密码登录,您可以执行以下操作:
或者,如果您有一个像我这样的非常大的网络,您可能并不真正想要这样。另一种方法是仅使用您的本地用户和组以及您当前登录的任何用户:
在我这样做之后,我终于能够正确运行 ssh-host-config 来创建服务。
Sorry to unbury such an old thread, but this question always came up when I googled this specific problem.
After a few months, I finally found a solution. When I set up cygwin, I didn't have my user and group accounts correctly created in cygwin. The main way to do this is to run:
If you are logging in using a domain user and passwd, you can do:
Or, if you have an incredibly large network like mine, you may not really want that. An alternative is to just user your local users and group plus whatever one you are currently logged in as:
After I did this, I was finally able to run ssh-host-config correctly to create the service.
我在 Windows 7 x64 和 sshd 上运行 cygwin 1.7。我不记得运行 sshd_config 时遇到此错误,但我只是查看了 /var/run 目录,它设置为 777。
在 cygwin shell 中尝试此操作
chmod 777 /var/run
I'm running cygwin 1.7 on Windows 7 x64 and sshd. I don't remember getting this error when I ran sshd_config, but I just looked at my /var/run directory and it's set to 777.
Try this in a cygwin shell
chmod 777 /var/run
我自己也遇到了很多麻烦。我发现默认安装步骤可以正常工作,只要我:
执行这些步骤后,默认安装步骤为:
之后,Windows 7 Professional 和 Home 上的一切似乎都工作正常。
如果您的 Cygwin sshd 安装已经失败,最好完全卸载并重新开始。
如果您需要的话,这里是 Cygwin 卸载说明:http://cygwin。 com/faq/faq.html#faq.setup.uninstall-all
I had a lot of trouble with this myself. I have found that the default install steps work just fine provided that I:
Once these steps have been taken, the default install steps are:
After that, everything seems to work fine on both Windows 7 Professional and Home.
If you already have a failed Cygwin sshd installation, it may be best to do a full uninstall and start fresh.
Here are the Cygwin uninstall instructions if you need them: http://cygwin.com/faq/faq.html#faq.setup.uninstall-all
我首先必须删除损坏的安装:
然后生成 passwd &如上所述的组:
然后我跑了:
最后“setuid failed”消息消失并且登录工作了。
I first had to remove the broken installation:
then generate passwd & group as mentioned above:
then I ran:
and finaly the "setuid failed" messages dissapeared and login worked.
在 cygwin shell 中,确保您是管理员:
In a cygwin shell, make sure you are administrator then:
在 Windows 资源管理器中,对于文件夹
/var
:这对我有用。
In Windows Explorer, for folder
/var
:It works for me.
当我在 NTFS 类型的硬盘驱动器上安装 Cygwin 时,我只能成功运行 ssh-host-config 脚本。当我将 Cygwin 安装在 exFAT 类型的闪存驱动器上时,ssh-host-config 脚本不起作用。
I was only able to run the ssh-host-config script successfully when I installed Cygwin on a hard drive of type NTFS. The ssh-host-config script did not work when I had Cygwin installed on a flash drive of type exFAT.
我也遇到了同样的问题。我相信我的问题是因为我有一个自定义的 /etc/fstab 文件,我在其中使用“noacl”选项安装根文件夹。以下是我解决问题的方法:
将自定义 /etc/fstab 移开:
<前><代码> mv /etc/fstab /etc/fstab.bak
或者,您可以编辑 /etc/fstab 文件并删除 noacl 选项。
关闭所有 Cygwin bash 窗口和任何其他 Cygwin 进程或服务。如果您有任何 Cygwin 进程正在运行,它将保留使用旧的 /etc/fstab 设置挂载的内容。
启动一个新的 Cygwin bash 窗口。
您可能需要运行以下命令。
<前><代码>chmod +r /etc/passwd
chmod o+x /var
chmod +w /var/run
交叉手指,运行 ssh-host-config,它现在应该完成,没有错误。
如果您在步骤 1 中移动了 /etc/fstab,现在可以将其移回来:
如果您在首次安装 Cygwin 后创建了新用户,请更新 /etc/passwd,否则这些用户可能无法通过 ssh 登录:
此外,请转到 Windows 防火墙,并允许 C: /cygwin/usr/sbin/sshd.exe 和 C:/cygwin/usr/sbin/sftp-server.exe
I was having the same problem. My problem, I believe, was because I had a custom /etc/fstab file where I was mounting the root folder with "noacl" option. Here is how I solved the problem:
Move the custom /etc/fstab out of the way:
Alternatively, you can edit your /etc/fstab file and remove the noacl option.
Close all Cygwin bash windows and any other Cygwin processes or services. If you have any Cygwin process running, it will keep things mounted with the old /etc/fstab settings.
Start a new Cygwin bash window.
You may need to run the following.
Cross your fingers, run ssh-host-config, and it should now complete without errors.
If you moved your /etc/fstab in Step 1, you can move it back now:
If you created new users after you first installed Cygwin, update /etc/passwd, otherwise those users may not be able login via ssh:
Also, go to Windows Firewall, and allow C:/cygwin/usr/sbin/sshd.exe and C:/cygwin/usr/sbin/sftp-server.exe
对于 Windows 用户,通过右键单击快捷方式运行“Cygwin Terminal”并以管理员身份运行....
现在运行 "<从 Cygwin 终端中的“strong>ssh-host-config”...它肯定会起作用。
for windows Users run "Cygwin Terminal" by right-clicking on shortcut and run it as a administrator....
Now Run "ssh-host-config" from the Cygwin Terminal...It will definitely work.