一· 在win系统下安装cygwin的步骤不在赘述,常见错误如下:
问题1]
# /usr/local/sbin/sshd /usr/local/sbin/sshd: error while loading shared libraries: libnsl.so.1: cannot open shared object file: No such file or directory
[分析与解决]
用strace跟踪sshd,查询缺少的目录和文件,给与相应的添补。
strace -f -F /usr/local/sbin/sshd
cp libnsl* /work/lib/
[问题2]
# /usr/local/sbin/sshd Privilege separation user sshd does not exist
[分析与解决]
没有sshd用户 sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
scp /etc/passwd root@HOST:/etc
scp /etc/shadow root@HOST:/etc
scp /etc/group root@HOST:/etc
[问题3]
# /usr/local/sbin/sshd Missing privilege separation directory: /var/empty
[分析与解决]
# mkdir /var/empty
[问题4]
[root@localhost .ssh]# ssh -l root 192.168.167.132
root@192.168.167.132's password:
Permission denied, please try again.
[分析与解决]
密码输入错误,重新连接尝试.?
[问题5]
# ./ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Could not create directory '/root/.ssh'.
[分析与解决]
# ls / bin etc linuxrc nfs sys var dev jffs2 lost+found proc tmpfs yaffs2 edwin lib mnt sbin usr # cd /root -sh: cd: can't cd to /root # mkdir root # cd /root # mkdir .ssh
[问题6]
# /usr/local/sbin/sshd
Missing privilege separation directory: /var/empty
[分析与解决]
# ls /var
# mkdir /var/empty
# /usr/local/sbin/sshd
?
[问题7]
[root@localhost ~]# ssh 192.168.167.132 ssh: connect to host 192.168.167.132 port 22: Connection refused
[分析与解决]
注释 /etc/hosts.deny? /etc/hosts.allow 中的限制部分.
net sshd stop
net sshd start
[问题9]
在客户端ssh到target后,用户帐户和密码验证通过,但是没有启动shell.
[分析与解决]
查看日志,发现有:PTY allocation request failed on channel 0
1.rm -rf /dev/ptmx
2.mknod /dev/ptmx c 5 2
3.chmod 666 /dev/ptmx
4.umount /dev/pts
5.rm -rf /dev/pts
6.mkdir /dev/pts
7.mount /dev/pts
[问题10]
客户端连接卡住,无法连进.
[分析与解决]
有可能是cyg维护死进程太多,此为cyg的BUG,用有权限的账号连入系统:
killall -9 bash
killall -9 sshd
net stop sshd
net start sshd
[问题11]
ssh 显示已经脸上,但马上断开.
[分析与解决]
查看当前用户 /etc/password 里shell的设置是否正确.
查看 /var/ 目录权限是否足够,包括所有者权限和文件权限.
查看当前用户的家目录是否设置正常,权限是否足够.
[问题12]
sshd 服务无法启动
[分析与解决]
$ net start sshd
发生系统错误 1069。
由于登录失败而无法启动服务。
-- 这是由于用户密码输入错误导致的,以后更改用户后sshd也可能发生这个问题,在 services.msc 里的登录标签里更改用户设置即可!
$ net start sshd
CYGWIN sshd 服务正在启动 .
CYGWIN sshd 服务已经启动成功。
事件 ID ( 0 )的描述(在资源( sshd )中)无法找到。
本地计算机可能没有必要的注册信息或消息 DLL 文件来从远程计算机显示消息。
您可能可以使用 /AUXSOURCE= 标识来检索词描述;查看帮助和支持以了解详细信息。
下列信息是事件的一部分: sshd: PID 2784: fatal: setreuid 1003: Permission denied.
-- 出现这种情况,需要重新安装服务.
net stop sshd
ssh-host-config
二·hadoop在eclipse中开发常见错误
1.run on hadoop没有反映
hadoop-0.20.0下自带的eclise插件已过时。
解决方案:
1、下载正确的插件:https://issues.apache.org/jira/secure/attachment/12460491/hadoop-eclipse-plugin-0.20.3-SNAPSHOT.jar
2、重命名:将下载的插件重命名为“hadoop-0.20.0-eclipse-plugin.jar"
3、替换原来的插件。
4、重启eclipse
2:run on hadoop 时错误
Caused by: java.io.IOException: Cannot run program “chmod”: CreateProcess error=2, ?????μ?? at java.lang.ProcessBuilder.start(ProcessBuilder.java:459) at org.apache.hadoop.util.Shell.runCommand(Shell.java:149) at org.apache.hadoop.util.Shell.run(Shell.java:134) at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:286) at org.apache.hadoop.util.Shell.execCommand(Shell.java:354) at org.apache.hadoop.util.Shell.execCommand(Shell.java:337) at org.apache.hadoop.fs.RawLocalFileSystem.execCommand(RawLocalFileSystem.java:481) at org.apache.hadoop.fs.RawLocalFileSystem.setPermission(RawLocalFileSystem.java:473) at org.apache.hadoop.fs.FilterFileSystem.setPermission(FilterFileSystem.java:280) at org.apache.hadoop.fs.FileSystem.mkdirs(FileSystem.java:266) at org.apache.hadoop.mapred.JobClient.configureCommandLineOptions(JobClient.java:573) at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:761) at org.apache.hadoop.mapred.JobClient.submitJob(JobClient.java:730) at cascading.flow.FlowStepJob.blockOnJob(FlowStepJob.java:162) at cascading.flow.FlowStepJob.start(FlowStepJob.java:138) at cascading.flow.FlowStepJob.call(FlowStepJob.java:127) at cascading.flow.FlowStepJob.call(FlowStepJob.java:39) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619)Caused by: java.io.IOException: CreateProcess error=2, ?????μ?? at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(ProcessImpl.java:81) at java.lang.ProcessImpl.start(ProcessImpl.java:30) at java.lang.ProcessBuilder.start(ProcessBuilder.java:452) … 21 more
解决方法:将cygwin的bin目录添加到Windows系统的PATH, 如果还不行,重启elipse即可