Commit da9a7228 authored by Liliya Givorgizova's avatar Liliya Givorgizova

NERZ-SWE-Plugin Version 0.7.0.

Gradle-Wrapper v.4.4.1.
Globale Libs gelöscht (werden aus Maven-Repo reserviert).
Konfiguration für FindBugsFilter hinzugefügt.
overview.html hinzugefügt.
build.xml gelöscht.
Platzhalter-Dateien gelöscht.
parent efff3425
V 2.0.1
=======
- Debug-Ausgabe korrigiert.
V 2.0.0
=======
- Zusätzliche Übertragungsprotokoll für SFTP integriert
- Neue Aufrufparamter
- -istFtp=ja|nein / Default-Wert = ja
- -ftpServerPort=ZAHL / Default-Wert bei -istFtp=ja ist 21, bei -istFtp=nein ist 22
====================================================================
V 2.0.0 28.06.2013
====================================================================
- Zusätzliche Übertragungsprotokoll für SFTP integriert
- Neue Aufrufparamter
-istFtp=ja|nein /* Default = ja
-ftpServerPort=ZAHL /* Default bei -istFtp=ja ist 21, bei -istFtp=nein ist 22
\ No newline at end of file
......@@ -2,38 +2,27 @@
// NERZ-SWE-Plugin
//--------------------------------------------------------------------
plugins {
id "de.bsvrz.gradle.nerzswe" version "0.4.0"
id "de.bsvrz.gradle.nerzswe" version "0.7.0"
}
//--------------------------------------------------------------------
// SWE-Eigenschaften
//--------------------------------------------------------------------
description 'ToDo' //TODO
description 'FTP-Verzeichnisüberwachung'
group 'de.inovat.kex'
version '2.0.0'
version '2.0.2-SNAPSHOT'
// Properties des NERZ-SWE-Plugins:
nerzswe {
mainClassName = ''
sweStatus = 'FREI'
// TODO anpassen:
sweDatum = '2017-11-29'
}
// Konfiguration:
project.afterEvaluate{
// JavaDoc ausschalten:
// project.tasks.javadoc.onlyIf { false }
// FindBugs ausschalten:
project.findbugs {
sourceSets = []
}
mainClassName = 'de.inovat.kex.ftp.Verzeichnisueberwachung'
sweStatus = 'BETA'
sweDatum = ''
}
//--------------------------------------------------------------------
// Abhängigkeiten
//--------------------------------------------------------------------
String kernsoftware_version = '3.9.2'
String kernsoftware_version = '3.9.7'
dependencies {
//------
// Source:
......@@ -44,29 +33,8 @@ dependencies {
compile group: 'de.bsvrz.sys', name: 'de.bsvrz.sys.funclib.hexdump', version: kernsoftware_version
compile group: 'de.bsvrz.sys', name: 'de.bsvrz.sys.funclib.dataIdentificationSettings', version: kernsoftware_version
compile group: 'de.bsvrz.sys', name: 'de.bsvrz.sys.funclib.asyncReceiver', version: kernsoftware_version
// libGlobal:
//
compile group: 'com.jcraft', name: 'jsch', version: '0.1.50'
compile group: 'commons-net', name: 'commons-net', version: '3.1'
compile fileTree(dir: 'lib/global.commons-net', include: '*.jar')
compile fileTree(dir: 'lib/jsch-0.1.50/lib', include: '*.jar')
//------
// Test:
// testCompile group: 'junit', name: 'junit', version: '4.12'
}
//--------------------------------------------------------------------
// Source
//--------------------------------------------------------------------
sourceSets {
main {
resources {
exclude { 'nichtVorhanden.txt' }
}
}
test {
java {
exclude { 'nichtVorhanden.txt' }
}
resources {
exclude { 'nichtVorhanden.txt' }
}
}
}
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
~ Copyright (c) 2010-2011 by inovat, innovative systeme - verkehr - tunnel - technik, Dipl.-Ing. H. C. Kniss
~
~ This file is part of D:/Entwicklung/NI-DAUZ-DAV-1/swe/de.inovat.kex.ftp/build.xml
~
~ D:/Entwicklung/NI-DAUZ-DAV-1/swe/de.inovat.kex.ftp/build.xml is free software; you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation; either version 2 of the License, or
~ (at your option) any later version.
~
~ D:/Entwicklung/NI-DAUZ-DAV-1/swe/de.inovat.kex.ftp/build.xml is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~ <p>
~ You should have received a copy of the GNU General Public License
~ along with D:/Entwicklung/NI-DAUZ-DAV-1/swe/de.inovat.kex.ftp/build.xml; if not, write to the Free Software
~ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
~
~ Contact Information:
~ inovat, Dipl.-Ing. H. C. Kniss
~ Koelner Strasse 30
~ D-50859 Koeln
~ +49 (0)2234 4301 800
~ info@invat.de
~ www.inovat.de
-->
<project name="SWE: de.inovat.kex.ftp" default="build-swe" basedir=".">
<!-- Status: ZERT, FREI, BETA, PROT, EXPT -->
<property name="swe.status" value="FREI"/>
<!-- Version -->
<property name="swe.version" value="V2.0.0"/>
<!-- Angabe der Lizenzen fr diese SWE, mgliche Werte: "BEIBEHALTEN", "INOVAT", "GPL", "LGPL" -->
<property name="swe-lizenz" value="GPL"/>
<!-- Legt fest, ob eventuell vorhanden Testsourcen in der Distribution vorhanden sein sollen. -->
<property name="test-sourcen-verwenden" value="nein"/>
<!-- Angabe der bentigten Sourcen fr diese SWE -->
<target name="src">
<hole-src>
<fileset dir="./src/" includes="**"/>
</hole-src>
</target>
<!-- Angabe der bentigten externen Libs fr diese SWE -->
<target name="externe-libs">
<hole-externe-libs>
<fileset dir="${dir.libs.extern}">
<include name="de.bsvrz.dav.daf/**/*.jar"/>
<include name="de.bsvrz.sys.funclib.debug/**/*.jar"/>
<include name="de.bsvrz.sys.funclib.commandLineArgs/**/*.jar"/>
<include name="de.bsvrz.sys.funclib.hexdump/**/*.jar"/>
<include name="de.bsvrz.sys.funclib.application/**/*.jar"/>
<include name="de.bsvrz.sys.funclib.dataIdentificationSettings/**/*.jar"/>
<include name="de.bsvrz.sys.funclib.asyncReceiver/**/*.jar"/>
<!--
<include name="de.bsvrz.dav.dav/**/*.jar"/>
<include name="de.bsvrz.puk.config/**/*.jar"/>
<include name="de.bsvrz.pat.datgen/**/*.jar"/>
<include name="de.bsvrz.pat.sysbed/**/*.jar"/>
<include name="de.bsvrz.pat.sysprot/**/*.jar"/>
<include name="de.bsvrz.sys.funclib.application/**/*.jar"/>
<include name="de.bsvrz.sys.funclib.communicationStreams/**/*.jar"/>
<include name="de.bsvrz.sys.funclib.concurrent/**/*.jar"/>
<include name="de.bsvrz.sys.funclib.configObjectAcquisition/**/*.jar"/>
<include name="de.bsvrz.sys.funclib.consoleProcessFrame/**/*.jar"/>
<include name="de.bsvrz.sys.funclib.crypt/**/*.jar"/>
<include name="de.bsvrz.sys.funclib.dataSerializer/**/*.jar"/>
<include name="de.bsvrz.sys.funclib.filelock/**/*.jar"/>
<include name="de.bsvrz.sys.funclib.operatingMessage/**/*.jar"/>
<include name="de.bsvrz.sys.funclib.timeout/**/*.jar"/>
<include name="de.bsvrz.sys.funclib.xmlSupport/**/*.jar"/>
<include name="de.kappich.pat.configBrowser/**/*.jar"/>
<include name="de.kappich.puk.param/**/*.jar"/>
<include name="de.kappich.samples.operatingMessage/**/*.jar"/>
<include name="de.kappich.sys.funclib.profile/**/*.jar"/>
<include name="de.kappich.tools.sleep/**/*.jar"/>
<include name="de.kappich.vew.bmvew/**/*.jar"/>
-->
</fileset>
</hole-externe-libs>
</target>
<!-- Angabe der bentigten globalen Libs fr diese SWE -->
<target name="globale-libs">
<hole-globale-libs>
<fileset dir="${dir.libs.global}">
<include name="global.junit/**/*.jar"/>
<include name="global.commons-net/**/*.jar"/>
<include name="jsch-0.1.50/**/*.jar"/>
</fileset>
</hole-globale-libs>
</target>
<!-- Angabe der bentigten TestSourcen fr diese SWE -->
<!-- Die Testsourcen werden nur verwendet, wenn das -->
<!-- Property "test-sourcen-verwenden" auf "ja" steht.-->
<!-- Damit kann die Auslieferung der Testsourcen -->
<!-- einfach ein- und ausgeschaltet werden. -->
<target name="test">
<hole-test>
<fileset dir="./test/" includes="**"/>
</hole-test>
</target>
<import file="../../ant/build-swe.xml"/>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter>
<Match>
<Bug pattern="DE_MIGHT_IGNORE"/>
</Match>
</FindBugsFilter>
# UTF-8
org.gradle.jvmargs='-Dfile.encoding=UTF-8'
......@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-bin.zip
This diff is collapsed.
This diff is collapsed.
JSch 0.0.* was released under the GNU LGPL license. Later, we have switched
over to a BSD-style license.
------------------------------------------------------------------------------
Copyright (c) 2002-2012 Atsuhiko Yamanaka, JCraft,Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution.
3. The names of the authors may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
JSch
Java Secure Channel
by ymnk@jcraft.com, JCraft,Inc.
http://www.jcraft.com/jsch/
Last modified: Wed Nov 1 14:43:31 UTC 2006
Description
===========
JSch is a pure Java implementation of SSH2. JSch allows you to
connect to an sshd server and use port forwarding, X11 forwarding,
file transfer, etc., and you can integrate its functionality
into your own Java programs. JSch is licensed under BSD style license.
Documentation
=============
* README files all over the source tree have info related to the stuff
in the directories.
* ChangeLog: what changed from the previous version?
Directories & Files in the Source Tree
======================================
* src/com/ has source trees of JSch
* example/ has some samples, which demonstrate the usages.
* tools/ has scripts for Ant.
Why JSch?
==========
Our intension in developing this stuff is to enable users of our pure
java X servers, WiredX(http://wiredx.net/) and WeirdX, to enjoy secure X
sessions. Our efforts have mostly targeted the SSH2 protocol in relation
to X Window System and X11 forwarding. Of course, we are also interested in
adding other functionality - port forward, file transfer, terminal emulation, etc.
Features
========
* JSch is in pure Java, but it depends on JavaTM Cryptography
Extension (JCE). JSch is know to work with:
o J2SE 1.4.0 or later (no additional libraries required).
o J2SE 1.3 and Sun's JCE reference implementation that can be
obtained at http://java.sun.com/products/jce/
o J2SE 1.2.2 and later and Bouncycastle's JCE implementation that
can be obtained at http://www.bouncycastle.org/
* SSH2 protocol support.
* Key exchange: diffie-hellman-group-exchange-sha1, diffie-hellman-group1-sha1
* Cipher: blowfish-cbc,3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc
3des-ctr,aes128-ctr,aes192-ctr,aes256-ctc,
arcfour,arcfour128,arcfour256
* MAC: hmac-md5,hmac-md5-96,hmac-sha1,hmac-sha1-96
* Host key type: ssh-dss, ssh-rsa
* Userauth: password
* Userauth: publickey(DSA,RSA)
* Userauth: keyboard-interactive
* Userauth: gssapi-with-mic
* X11 forwarding.
* xauth spoofing.
* connection through HTTP proxy.
* connection through SOCKS5, SOCKS4 proxy.
* port forwarding.
* stream forwarding.
* signal sending.
The unofficial patch for sshd of openssh will be find in the thread
http://marc.theaimsgroup.com/?l=openssh-unix-dev&m=104295745607575&w=2
* envrironment variable passing.
* remote exec.
* generating DSA and RSA key pairs.
* SSH File Transfer Protocol(version 0, 1, 2, 3)
* partial authentication
* packet compression: zlib, zlib@openssh.com
JZlib(http://www.jcraft.com/jzlib/) has been used.
* hashed known_hosts file.
* NONE Cipher switching.
http://www.psc.edu/networking/projects/hpn-ssh/none.php
* JSch is licensed under BSD style license(refer to LICENSE.txt).
How To Try
==========
This archive does not include java byte code, so please compile
the source code by your self.
$ cd jsch-?.?.?/src
$ javac com/jcraft/jsch/*java com/jcraft/jsch/jce/*java com/jcraft/jzlib/*.java
'/examples/' directory has included some samples to demonstrate what
JSch can do. Please refer to '/examples/README' file.
AES cipher
==========
JSch supports aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,
aes256-ctr but you require AES support in your J2SE to choose some of them.
If you are using Sun's J2SE, J2SE 1.4.2 or later is required.
And then, J2SE 1.4.2(or later) does not support aes256 by the default,
because of 'import control restrictions of some countries'.
We have confirmed that by applying
"Java Cryptography Extension (JCE)
Unlimited Strength Jurisdiction Policy Files 1.4.2"
on
http://java.sun.com/j2se/1.4.2/download.html#docs
we can enjoy 'aes256-cbc,aes256-ctr'.
Stream Forwarding
=================
JSch has a unique functionality, Stream Forwarding.
Stream Forwarding allows you to plug Java I/O streams directly into a remote TCP
port without assigning and opening a local TCP port.
In port forwarding, as with the -L option of ssh command, you have to assign
and open a local TCP port and that port is also accessible by crackers
on localhost. In some case, that local TCP port may be plugged to a
secret port via SSH session.
A sample program, /example/StreamForwarding.java , demonstrates
this functionality.
Generating Authentication Keys
==============================
JSch allows you to generate DSA and RSA key pairs, which are in OpenSSH format.
Please refer to 'examples/KeyGen.java'.
Packet Compression
==================
According to the draft from IETF sesch working group, the packet
compression can be applied to each data stream directions; from sshd
server to ssh client and from ssh client to sshd server. So, jsch
allows you to choose which data stream direction will be compressed or not.
For example, in X11 forwarding session, the packet compression for data
stream from sshd to ssh client will save the network traffic, but
usually the traffic from ssh client to sshd is light, so by omitting
the compression for this direction, you may be able to save some CPU time.
Please refer to a sample program 'examples/Compression.java'.
Property
========
By setting properties, you can control the behavior of jsch.
Here is an example of enabling the packet compression,
Session session=jsch.getSession(user, host, 22);
java.util.Properties config=new java.util.Properties();
config.put("compression.s2c", "zlib,none");
config.put("compression.c2s", "zlib,none");
session.setConfig(config);
session.connect();
Current release has supported following properties,
* compression.s2c: zlib, none
default: none
Specifies whether to use compression for the data stream
from sshd to jsch. If "zlib,none" is given and the remote sshd does
not allow the packet compression, compression will not be done.
* compression.c2s: zlib, none
default: none
Specifies whether to use compression for the data stream
from jsch to sshd.
* StrictHostKeyChecking: ask | yes | no
default: ask
If this property is set to ``yes'', jsch will never automatically add
host keys to the $HOME/.ssh/known_hosts file, and refuses to connect
to hosts whose host key has changed. This property forces the user
to manually add all new hosts. If this property is set to ``no'',
jsch will automatically add new host keys to the user known hosts
files. If this property is set to ``ask'', new host keys will be
added to the user known host files only after the user has confirmed
that is what they really want to do, and jsch will refuse to connect
to hosts whose host key has changed.
TODO
====
* re-implementation with java.nio.
* replacing cipher, hash by JCE with pure Java code.
* SSH File Transfer Protocol version 4.
* error handling.
Copyrights & Disclaimers
========================
JSch is copyrighted by ymnk, JCraft,Inc. and is licensed through BSD style license.
Read the LICENSE.txt file for the complete license.
Credits and Acknowledgments
============================
JSch has been developed by ymnk@jcraft.com and it can not be hacked
without several help.
* First of all, we want to thank JCE team at Sun Microsystems.
For long time, we had planed to implement SSH2 in pure Java,
but we had hesitated to do because tons of work must be done for
implementing ciphers, hashes, etc., from the scratch.
Thanks to newly added functionalities to J2SE 1.4.0, we could
start this project.
* We appreciate the OpenSSH project.
The options '-ddd' of sshd, '---vvv' of ssh and the compile options
'-DPACKET_DEBUG', '-DDEBUG_KEXDH' and '-DDEBUG_KEX' were very
useful in debugging JSch.
* We appreciate IETF sesch working group and SSH Communications Security Corp.
Without the standardization of the protocol, we could not get the
chance to implement JSch.
* We appreciate Seigo Haruyama(http://www.unixuser.org/~haruyama/),
who are interpreting drafts of SSH2 protocol in Japanese.
His works were very useful for us to understand the technical terms
in our native language.
* We also appreciate SourceForge.net's awesome service to the
Open Source Community.
If you have any comments, suggestions and questions, write us
at jsch@jcraft.com
``SSH is a registered trademark and Secure Shell is a trademark of
SSH Communications Security Corp (www.ssh.com)''.
@echo off
echo.
echo JSch Build System
echo -----------------
set OLD_ANT_HOME=%ANT_HOME%
set ANT_HOME=tools
set OLD_CLASSPATH=%CLASSPATH%
%ANT_HOME%\bin\ant.bat -emacs %1 %2 %3 %4 %5 %6 %7 %8
goto cleanup
:cleanup
set ANT_HOME=%OLD_ANT_HOME%
set CLASSPATH=%OLD_CLASSPATH%
#!/bin/sh
echo
echo "JSch Build System"
echo "-----------------"
export OLD_ANT_HOME=$ANT_HOME
ANT_HOME=./tools
export OLD_CLASSPATH=$CLASSPATH
export CLASSPATH
chmod u+x ${ANT_HOME}/bin/antRun
chmod u+x ${ANT_HOME}/bin/ant
export PROPOSAL=""
${ANT_HOME}/bin/ant -emacs $@
export CLASSPATH=$OLD_CLASSPATH
export ANT_HOME=$OLD_ANT_HOME
<project name="Jsch" default="dist" basedir=".">
<description>
JSch is a pure Java implementation of SSH2. JSch allows you to connect to an
sshd server and use port forwarding, X11 forwarding, file transfer, etc., and
you can integrate its functionality into your own Java programs
</description>
<!-- set global properties for this build -->
<property name="version" value="0.1.50"/>
<property name="src" location="src/main/java/"/>
<property name="exasrc" location="examples"/>
<property name="build" location="build"/>
<property name="exabuild" location="examples"/>
<property name="dist" location="dist"/>
<property name="javadoc" location="javadoc"/>
<property name="javac.debug" value="true"/>
<path id="lib.path.ref">
<fileset dir="lib" includes="*.jar"/>
</path>
<path id="project.cp">
<pathelement location="${build}"/>
</path>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
</target>
<target name="compile" depends="init"
description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<available property="jzlib.available"
classname="com.jcraft.jzlib.ZStream">
<classpath refid="lib.path.ref"/>
</available>
<javac srcdir="${src}"
destdir="${build}"
target="1.4"
source="1.4"
debug="${javac.debug}">
<classpath refid="lib.path.ref"/>
<exclude name="com/jcraft/jsch/jcraft/Compression.java"
unless="jzlib.available"/>
</javac>
</target>
<target name="dist" depends="compile"
description="generate the distribution" >
<!-- Create the distribution directory -->
<mkdir dir="${dist}/lib"/>
<!-- Put everything in ${build} into the MyProject-${version}.jar file -->
<jar jarfile="${dist}/lib/jsch-${version}.jar" basedir="${build}">
<!--
<manifest>
<attribute name="Bundle-ClassPath" value="."/>
<attribute name="Bundle-Vendor" value="JCraft, Inc."/>
<attribute name="Bundle-Name" value="com.jcraft.jsch"/>
<attribute name="Bundle-ManifestVersion" value="2"/>
<attribute name="Bundle-SymbolicName" value="com.jcraft.jsch"/>
<attribute name="Bundle-Version" value="${version}"/>
<attribute name="Export-Package" value='com.jcraft.jsch;version="${version}",com.jcraft.jsch.jce;version="${version}";x-internal:=true,com.jcraft.jsch.jcraft;version="${version}";x-internal:=true,com.jcraft.jsch.jgss;version="${version}";x-internal:=true'/>
<attribute name="Import-Package" value="javax.crypto,javax.crypto.spec,javax.crypto.interfaces,org.ietf.jgss,com.jcraft.jzlib"/>
</manifest>
-->
</jar>
</target>
<target name="examples"
description="compiles the examples"
depends="compile">
<path id="compile.classpath">
<pathelement location="${build}" />
</path>
<javac srcdir="${exasrc}" destdir="${exabuild}">
<classpath refid="compile.classpath"/>
</javac>
</target>
<target name="clean"
description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete dir="${dist}"/>
<delete dir="${javadoc}"/>
</target>
<target name="javadoc">
<javadoc sourcepath="${src}"
destdir="${javadoc}"
>
<packageset dir="${src}"/>
</javadoc>
</target>
</project>
/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
/**
* This program will demonstrate how to use "aes128-cbc".
*
*/
import com.jcraft.jsch.*;
import java.awt.*;
import javax.swing.*;
public class AES{
public static void main(String[] arg){
try{
JSch jsch=new JSch();
//jsch.setKnownHosts("/home/foo/.ssh/known_hosts");
String host=null;
if(arg.length>0){
host=arg[0];
}
else{
host=JOptionPane.showInputDialog("Enter username@hostname",
System.getProperty("user.name")+
"@localhost");
}
String user=host.substring(0, host.indexOf('@'));
host=host.substring(host.indexOf('@')+1);
Session session=jsch.getSession(user, host, 22);
//session.setPassword("your password");
// username and password will be given via UserInfo interface.
UserInfo ui=new MyUserInfo();
session.setUserInfo(ui);
session.setConfig("cipher.s2c", "aes128-cbc,3des-cbc,blowfish-cbc");
session.setConfig("cipher.c2s", "aes128-cbc,3des-cbc,blowfish-cbc");
session.setConfig("CheckCiphers", "aes128-cbc");
session.connect();
Channel channel=session.openChannel("shell");
channel.setInputStream(System.in);
channel.setOutputStream(System.out);
channel.connect();
}
catch(Exception e){
System.out.println(e);
}