歡迎您光臨本站 註冊首頁

開啟windows2003下的cygwin的sshd的過程

←手機掃碼閱讀     火星人 @ 2014-03-12 , reply:0
  

確保etc和var目錄許可權
Administrator@apple /etc
$ ls -ld /*
drwxrwxr-x+ 22 Administrators None    0 Jun 11 10:47 /etc
drwxrwxrwx+ 12 Administrators None    0 Nov 11  2008 /var


查看以前是否安裝過ssd,使用下面的命令刪除服務

Administrator@apple ~
$ cygrunsrv -L
sshd

Administrator@apple ~
$ cygrunsrv -R sshd

刪除以前安裝的sshd的配置文件
Administrator@apple ~
$ rm /etc/ssh* -f

刪除以前安裝的sshd的日誌文件

Administrator@apple ~
$ rm /var/log/sshd.log

使用ssh-host-config設置sshd

Administrator@apple ~
$ ssh-host-config
*** Info: Generating /etc/ssh_host_key
*** Info: Generating /etc/ssh_host_rsa_key
*** Info: Generating /etc/ssh_host_dsa_key
*** Info: Creating default /etc/ssh_config file
*** 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) yes
*** Warning: The file /etc/passwd is not readable by all.
*** Warning: Please run 'chmod +r /etc/passwd'.
*** ERROR: Problem with LocalSystem or Adminstrator IDs

說/etc/passwd許可權有問題,使用下面的命令修改這個文件的許可權

Administrator@apple ~
$ chmod +r /etc/passwd

如果/etc/group文件許可權不對的話,需要修改/etc/group的許可權

 

再一次刪除配置和日誌文件

Administrator@apple ~
$ rm /etc/ssh* -f

Administrator@apple ~
$ rm /var/log/sshd.log
rm: cannot remove `/var/log/sshd.log': No such file or directory

再一次使用ssh-host-config配置sshd

Administrator@apple ~
$ ssh-host-config
*** Query: Overwrite existing /etc/ssh_config file? (yes/no) 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) yes
*** Info: Updating /etc/sshd_config file
*** Query: Overwrite existing /etc/inetd.d/sshd-inetd file? (yes/no) yes
*** Info: Creating default /etc/inetd.d/sshd-inetd file
*** Info: Updated /etc/inetd.d/sshd-inetd


*** 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
*** Info: Note that the CYGWIN variable must contain at least "ntsec"
*** Info: for sshd to be able to change user context without password.
*** 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: You appear to be running Windows 2003 Server or later.  On 2003 and
*** Info: later systems, it's not possible to use the LocalSystem account
*** Info: for services that can change the user id without an explicit password
*** Info: (such as passwordless logins [e.g. public key authentication] via sshd
).

*** Info: If you want to enable that functionality, it's required to create a ne
w
*** Info: account with special privileges (unless a similar account already exis
ts).
*** Info: This account is then used to run these special servers.

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

*** Info: The following privileged accounts were found: 'cyg_server' .

*** Info: This script plans to use 'cyg_server'.
*** Info: 'cyg_server' will not be able to log on interactively, but will only
*** Info: be used by registered services.
*** Query: Do you want to use different name? (yes/no) no
*** Query: Please enter the password for user 'cyg_server':
*** Query: Reenter:


*** Info: The sshd service has been installed under the '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!

使用下面的命令啟動sshd服務

Administrator@apple ~
$ cygrunsrv -S sshd

注意:
sshd在cyg_server帳戶下運行,

 

好運!

 

 

 

 

 

 



[火星人 ] 開啟windows2003下的cygwin的sshd的過程已經有500次圍觀

http://coctec.com/docs/program/show-post-71663.html