您好,欢迎光临本网站![请登录][注册会员]  
文件名称: ganymed-ssh2-build251beta1.zip
  所属分类: Java
  开发工具:
  文件大小: 597kb
  下载次数: 0
  上传时间: 2012-09-01
  提 供 者: wujins******
 详细说明: Ganymed SSH-2 for Java is an open source library which implements the SSH-2 protocol in pure Java (tested on J2SE 1.4.2 and 5.0). It allows one to connect to SSH servers from within Java programs. It supports SSH sessions (remote command execution and shell access), local and remote port forwarding, local stream forwarding, X11 forwarding, SCP and SFTP. There are no dependencies on any JCE provider, as all crypto functionality is included. Originally, Ganymed SSH-2 for Java was developed for the Ganymed replication project at E TH Zurich (Switzerland). Ganymed SSH-2 for Java is the de-facto standard for open source based SSH communication in Java software. The library is used in many industrial products but also in open source software, e.g., in the widely used SVN plugin for Eclipse and in Cyberduck (a popular SFTP client for the Mac). When I start program XYZ with putty (or openssh, ..., whatever) then everything works. However, if I use "Session.execCommand", then XYZ behaves differently or does not work at all! Short answer: The most often source of problems when executing a command with Session.execCommand() are missing/wrong set environment variables on the remote machine. Make sure that the minimum needed environment for XYZ is the same, independentely on how the shell is being invoked. Example quickfix for bash users: Define all your settings in the file ~/.bashrc Make sure that the file ~/.bash_profile only contains the line source ~/.bashrc. Before executing Session.execCommand(), do NOT aquire any type of pseudo terminal in the session. Be prepared to consume stdout and stderr data. Note: If you really want to mimic the behavior of putty, then don't use Session.execCommand(), instead aquire a pty (pseudo terminal) and then start a shell (use Session.requestPTY() and Session.startShell()). You then have to communicate with the shell process at the other end through stdin and stdout. However, you also have to implement terminal logic (e.g., escape sequence handling (unless you use a "dumb" pty), "expect-send" logic (output parsing, shell prompt detection), etc.). Long answer: If you login by using putty, then putty will normally request a "xterm" pty and your assigned shell (e.g., bash) will be started (a so called "interactive login shell"). In contrast, if you use Session.execCommand() to start a command then (unless you ask for it) no pty will be aquired and the command will be given to the shell as an argument (with the shell's "-c" option). The way a shell is being invoked has an effect on the set of initialization files which will be read be the shell. To demonstrate the difference, try the following (from the command line, e.g., with an OpenSSH client): Login interactively and print the environment with the "env" command: [user@host ~] ssh 127.0.0.1 [user@host ~] env Let the ssh server execute the "env" command (equivalent to using Session.executeCommand()): [user@host ~] ssh 127.0.0.1 "env" If you compare the two outputs, then you will (unless you have adjusted your shell's settings) observe different environments. If you are interested in the details, then please read the INVOCATION section in man page for the bash shell. You may notice that the definitions of "interactive" and "non-interactive" (and combinations with "login") are little bit tricky. ...展开收缩
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 相关搜索: selenium
 输入关键字,在本站1000多万海量源码库中尽情搜索: