在装完cygwin后我们一般将它添加到win7系统环境变量PATH中:
D:cygwinin;D:cygwinusrsbin;
cygwin编译搭建hadoop环境需要安装的软件包:
1.openssh
2.openssl
3.sed
4.zlib
4.tcp_wrappers
5.diffutils
6.vim
7.subversion
右搖管理员身份运行
cygwin输出的中文部分,显示乱码
右键cygwin图标->Option》text
Locale=(选择default会自动变成)C,,Character Set=GBK=>
结果终于可以正常显示中文了:
icecutie@ice ~
$ 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)
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: []
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 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: No privileged account could be found.
*** 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: Create new privileged user account 'cyg_server'?
(yes/no) yes
*** Info: Please enter a password for new user cyg_server.
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_server' has been created with password
'123456'.
*** 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_server' account.
*** Info: Also keep in mind that the user 'cyg_server' needs
read permissions
*** Info: on all users' relevant files for the services
running as 'cyg_server'.
*** 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_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!
icecutie@ice ~
$ net start sshd
CYGWIN sshd 服务正在启动 .
CYGWIN sshd 服务已经启动成功。
icecutie@ice ~
$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key
(/home/icecutie/.ssh/id_rsa):
Created directory '/home/icecutie/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in
/home/icecutie/.ssh/id_rsa.
Your public key has been saved in
/home/icecutie/.ssh/id_rsa.pub.
The key fingerprint is:
ed:e8:08:fd:dd:f1:f0:14:ab:f0:84:fd:53:7c:14:ca
icecutie@ice
The key's randomart image is:
+--[ RSA 2048]----+
|
|
|
. |
|
. .
.|
|
. E
.|
|
S . .o |
| . o
o o+|
| . . . + = o..|
| . + . = O.
|
| . o
. + +. |
+-----------------+
icecutie@ice ~
$ cd .ssh
icecutie@ice ~/.ssh
$ ls
id_rsa id_rsa.pub
icecutie@ice ~/.ssh
$ cp id_rsa.pub authorized_keys
icecutie@ice ~/.ssh
$ ls
authorized_keys id_rsa
id_rsa.pub
icecutie@ice ~/.ssh
$ ssh localhost
ssh: connect to host localhost port 22: Connection
refused
竟然报错啊 不爽啊
vi /var/log/sshd.log
Privilege separation user sshd does not exist
说要修改/etc/sshd_config 用vi修改会出现键盘不匹配 真尼玛
泽哥及时赶到
vi下面有很多命令
cw修改下一个单词
修改UsePrivilegeSeparation sandbox 为UsePrivilegeSeparation
no
:wq 保存 搞定!
泽哥太给力了
在windows服务管理器中找到sshd 右键启动 显示正在启动
icecutie@ice ~
$ ssh localhost
The authenticity of host 'localhost (::1)' can't be
established.
ECDSA key fingerprint is
6c:b9:be:dd:b7:d8:fd:6d:62:82:8b:bc:62:8b:0d:5b.
Are you sure you want to continue connecting (yes/no)?
yes
Warning: Permanently added 'localhost' (ECDSA) to the list of
known hosts.
icecutie@ice ~
$ exit
logout
Connection to localhost closed.
icecutie@ice ~
$ ssh localhost
Last login: Wed May 15 19:43:33 2013 from ::1
icecutie@ice ~
$
搞定了