Cygwin ssh服務配置 (SecureCRT鏈接Cygwin配置)

一、運行ssh-host-configapp

這裏須要注意的是標紅部分,輸入的用戶名或密碼要符合計算機的用戶名或密碼策略(尤爲是公司有權限限制的電腦)。less

$ 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/README.privsep.
*** Query: Should privilege separation be used? (yes/no) yes
*** Warning: sshd is in /etc/passwd, but the
*** Warning: local machine's SAM does not know about sshd.
*** Warning: Perhaps sshd is a pre-existing domain account.
*** Warning: Continuing, but check if this is ok.
*** Info: Updating /etc/sshd_config file

*** 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: cyg_server is in /etc/passwd, but the local
*** Warning: machine's SAM does not know about cyg_server.
*** Warning: Perhaps cyg_server is a pre-existing domain account.
*** Warning: Continuing, but check if this is ok.
*** Info: You appear to be running Windows XP 64bit, Windows 2003 Server,
*** Info: or later.  On these systems, it's not possible to use the LocalSystem
*** Info: account for services that can change the user id without an
*** Info: explicit password (such as passwordless logins [e.g. public key
*** Info: authentication] via sshd).

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

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

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

*** Info: This script plans to use 'cyg_server'.
*** Info: 'cyg_server' will only be used by registered services.
*** Query: Do you want to use a different name? (yes/no) yes
*** Query: Enter the new user name: cyg_user123
*** Query: Reenter: cyg_user123

*** Query: Create new privileged user account 'cyg_user123'? (yes/no) yes
*** Info: Please enter a password for new user cyg_user123.  Please be sure
*** Info: that this password matches the password rules given on your system.
*** Info: Entering no password will exit the configuration.
*** Query: Please enter the password:
*** Query: Reenter:

*** Info: User 'cyg_user123' has been created with password 'Tough_01'.
*** Info: If you change the password, please remember also to change the
*** Info: password for the installed services which use (or will soon use)
*** Info: the 'cyg_user123' account.

*** Info: Also keep in mind that the user 'cyg_user123' needs read permissions
*** Info: on all users' relevant files for the services running as 'cyg_user123'.
*** Info: In particular, for the sshd server all users' .ssh/authorized_keys
*** Info: files must have appropriate permissions to allow public key
*** Info: authentication. (Re-)running ssh-user-config for each user will set
*** Info: these permissions correctly. [Similar restrictions apply, for
*** Info: instance, for .rhosts files if the rshd server is running, etc].


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

最後一句話說明ssh服務安裝成功。dom

 

二、啓動 sshd服務ssh

$ net start sshd
The CYGWIN sshd service is starting.
The CYGWIN sshd service was started successfully.

 

三、本地ssh鏈接測試測試

$ ssh localhost
The authenticity of host 'localhost (::1)' can't be established.
ECDSA key fingerprint is 84:4f:13:3e:f7:55:3f:a2:d2:50:26:f5:1b:72:85:fb.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
toughhou@localhost's password:

 

四、用SecureCRT鏈接cygwin本機
鏈接地址:          127.0.0.1
鏈接端口:          22
用戶名密碼:     本身機器的用戶名及密碼,不是以前配置的cyg_user123ui

相關文章
相關標籤/搜索