public void sendSSH(IMessage message, boolean toVM) throws IOException,
			JSchException {
		JSch jsch = new JSch();
		Session session;
		if (toVM) {
			session = jsch.getSession("root", receiver.getHostAddress(), 22);
			jsch.addIdentity("~/.ssh/id_dsa");

		} else {
			session = jsch
					.getSession(DefaultNetworkVariables.DAS4_USERNAME, receiver.getHostAddress(), 22);
			session.setPassword(DefaultNetworkVariables.DAS4_PASSWORD);
		}

		session.setConfig("StrictHostKeyChecking", "no");
		session.connect();

		PipedInputStream pis = new PipedInputStream();
		PipedOutputStream pos = new PipedOutputStream(pis);
		ObjectOutputStream oos = new ObjectOutputStream(pos);

		Channel channel = session.getStreamForwarder(receiver.getHostAddress(),
				port);
		channel.setInputStream(pis);
		channel.connect(1000);

		oos.writeObject(message);

		oos.close();

		while (!channel.isClosed())
			try {
				Thread.sleep(10);
			} catch (InterruptedException e) {
				e.printStackTrace();
				break;
			}

		channel.disconnect();
	}