http://www.blogjava.net/Man/archive/2012/11/26/392004.html
ssh 作为服务器,开启失败可以查看日志:var/log/sshd.log
正确的安装:
先uninstall 在install (注意全部的cygwin都关掉的情况下。)
tplink@tplink-PC1 ~
$ 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) no
*** 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.
*** 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) no
*** Query: Please enter the password for user 'cyg_server':
*** Query: Please enter the password for user 'cyg_server':
*** 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!
tplink@tplink-PC1 ~
$ net start sshd
CYGWIN sshd 服务正在启动 .
CYGWIN sshd 服务已经启动成功。
ubuntu下面使用静态ip方法:
http://os.51cto.com/art/201210/361003.htm
主要是设置一下文件:
1. 启动虚拟机Ubuntu系统,打开终端,利用如下命令打开并编辑网络接口配置文件:
sudo vi /etc/network/interfaces
2. 编辑文件如下:
auto lo iface lo inet loopback # Assgin static IP by eric on 26-SEP-2012 iface eth0 inet static address 192.168.91.200 #change to your static IP netmask 255.255.255.0 #change to your netmask gateway 192.168.91.2 #change to your getway #We must specify dns-nameserver here #in order to get internet access from host dns-nameservers 192.168.91.2 auto eth0