Loading... <p>OS: Windows Server 2003 R2</p> <p>1. 从 <span class="external-link"><a class="no-external-link" href="http://www.cywin.com" target="_blank"><i data-feather="external-link"></i>www.cywin.com</a></span> 下载 setup.exe 安装引导程序</p> <p>2. 双击 setup.exe 开始安装<br /> 3. 选择安装源 Install for Internet ( 如果有上次从 Internet 下载的软件包,可以选择 Install for Local Directory 选择存放的目录即可)<br /> 4. 定义安装目录 C:\cygwin (1) Install for : All Users (2) Default Text File Type: Unix/binary<br /> 5. 定义下载软件所存放目录,(下次可以使用下载包从本地硬盘进行安装) .G:\Download\cywin<br /> 6. 选择连接 Internet 的类型,根据自己的实际情况选择<br /> 7. 选择一个镜像下载站点<br /> 8. 选择安装软件包<br /> (1) Admini 中选择: cygrunsrv <br /> (2) DOC 中选择: cygwin-doc <br /> (3) Net 中选择:openssh<br /> 9. cygwin 自动下载选择的软件包,并进行安装。<br /> 10. 在我的电脑->属性->高级->环境变量中配置加入变量CYGWIN=ntsec,<br /> 在path环境变量中加入cygwin\bin路径, 例如: ;c:\cygwin\bin <br /> 11. 双击Windows上安装好的 Cywin快捷图标,启动 Cywin<br /> Copying skeleton files.<br /> These files are for the user to personalise<br /> their cygwin experience.<br /> These will never be overwritten.<br /> `./.bashrc' -> `/home/Administrator//.bashrc'<br /> `./.bash_profile' -> `/home/Administrator//.bash_profile'<br /> `./.inputrc' -> `/home/Administrator//.inputrc'<br /> 12. 给文件授权,以完成sshd 服务的安装<br /> chmod +r /etc/group<br /> chmod +r /etc/passwd<br /> chmod +rwx /var<br /> 13. 安装 sshd 服务<br /> $ ssh-host-config <br /> 详细的安装步骤,以及输入的参数,如下所例:<br /> Copying skeleton files.<br /> These files are for the user to personalise<br /> their cygwin experience.<br /> These will never be overwritten.<br /> `./.bashrc' -> `/home/Administrator//.bashrc'<br /> `./.bash_profile' -> `/home/Administrator//.bash_profile'<br /> `./.inputrc' -> `/home/Administrator//.inputrc'<br /> <a href="mailto:Administrator@backup">Administrator@backup</a> ~<br /> $ chmod +r /etc/group # 对文件权限<br /> <a href="mailto:Administrator@backup">Administrator@backup</a> ~<br /> $ chmod +r /etc/passwd # 对文件权限<br /> <a href="mailto:Administrator@backup">Administrator@backup</a> ~<br /> $ chmod +rwx /var/ # 对文件权限<br /> <a href="mailto:Administrator@backup">Administrator@backup</a> ~<br /> $ ssh-host-config # 引导SSH服务配置<br /> *** Info: Generating /etc/ssh_host_key<br /> *** Info: Generating /etc/ssh_host_rsa_key<br /> *** Info: Generating /etc/ssh_host_dsa_key<br /> *** Info: Creating default /etc/ssh_config file<br /> *** Info: Creating default /etc/sshd_config file<br /> *** Info: Privilege separation is set to yes by default since OpenSSH 3.3.<br /> *** Info: However, this requires a non-privileged account called 'sshd'.<br /> *** Info: For more info on privilege separation read /usr/share/doc/openssh/READ<br /> ME.privsep.<br /> *** Query: Should privilege separation be used? (yes/no) yes<span style="color: #f00"> #输入yes</span><br /> *** Info: Updating /etc/sshd_config file<br /> *** Warning: The following functions require administrator privileges!<br /> *** Query: Do you want to install sshd as a service?<br /> *** Query: (Say "no" if it is already installed as a service) (yes/no) yes<span style="color: #f00"> #输入yes</span><br /> *** Info: Note that the CYGWIN variable must contain at least "ntsec"<br /> *** Info: for sshd to be able to change user context without password.<br /> *** Query: Enter the value of CYGWIN for the daemon: [ntsec] ntsec <span style="color: #f00">#输入ntsec</span> <br /> *** Info: On Windows Server 2003, Windows Vista, and above, the<br /> *** Info: SYSTEM account cannot setuid to other users -- a capability<br /> *** Info: sshd requires. You need to have or to create a privileged<br /> *** Info: account. This script will help you do so.<br /> *** Info: You appear to be running Windows 2003 Server or later. On 2003 and<br /> *** Info: later systems, it's not possible to use the LocalSystem account<br /> *** Info: for services that can change the user id without an explicit password<br /> *** Info: (such as passwordless logins [e.g. public key authentication] via sshd<br /> ).<br /> *** Info: If you want to enable that functionality, it's required to create a ne<br /> w<br /> *** Info: account with special privileges (unless a similar account already exis<br /> ts).<br /> *** Info: This account is then used to run these special servers.<br /> *** Info: Note that creating a new user requires that the current account have<br /> *** Info: Administrator privileges itself.<br /> *** Info: No privileged account could be found.<br /> *** Info: This script plans to use 'cyg_server'.<br /> *** Info: 'cyg_server' will only be used by registered services.<br /> *** Query: Do you want to use a different name? (yes/no) no <span style="color: #f00">#输入no,不指定启动用户</span><br /> *** Query: Create new privileged user account 'cyg_server'? (yes/no) no <span style="color: #f00">#输入no,不指定启动用户</span><br /> *** ERROR: There was a serious problem creating a privileged user.<br /> *** Query: Do you want to proceed anyway? (yes/no) yes <span style="color: #f00">#输入yes<br /> </span>*** Warning: Expected privileged user 'cyg_server' does not exist.<br /> *** Warning: Defaulting to 'SYSTEM'<br /> *** Info: The sshd service has been installed under the LocalSystem<br /> *** Info: account (also known as SYSTEM). To start the service now, call<br /> *** Info: `net start sshd' or `cygrunsrv -S sshd'. Otherwise, it<br /> *** Info: will start automatically after the next reboot.<br /> *** Info: Host configuration finished. Have fun!<br /> <a href="mailto:Administrator@backup">Administrator@backup</a> ~<br /> $ cygrunsrv.exe -S sshd <span style="color: #f00"># 启动 SSH服务</span><br /> 14. 安装完成后,检查一下系统服务中是否有 CYGWIN sshd 服务, 无启动帐号.<br /> 15. 检查系统用户 sshd 是否已启用, 并属于管理员组.<br /> 16. 一切正常,即可启动ssh服务. 登录的用户名是sshd, 密码是 sshd用户的密码.</p> Last modification:October 6, 2023 © Allow specification reprint Support Appreciate the author AliPayWeChat Like 如果觉得我的文章对你有用,请随意赞赏