"Session" and "Channel" (JSch and sshd)

I want to move small files (at unknown moments and in unknown quantities) from one server to another using JSch - unfortunately I tried to open sessions for each transfer, which was quickly bombed (since MaxSessions I assumed 10?).

Then I opened one session (per host) using JSch and just created a channel for each action (one transfer created a channel, put a file, closed a channel), but I ran into the same (when trying to do this 10 or more at a time, I would receive connections as some channels were still closing when another request came in).

So, I looked at sshd_config and realized that they have a MaxSessions property that would come in very handy here - but I wondered if there was a MaxChannelsPerSession property, or I was confused as to what JSch calls the "channel" and what is the actual SSH channel.

I am using the most recent version of JSch as of 20120316.

(And most importantly, should I post this elsewhere on the site? It has to do with some programming, but I think it's part of sysadmin too ...)

+3


source to share


2 answers


I am the author of JSch.



The "MaxSessions" sshd_config property will be recognized as "MaxChannelsPerSession" on OpenSSH sshd.

+5


source


Just for another alternative:

For file transfers, JSch offers the ChannelSftp class . With it, you can transfer multiple files one after the other (or even in parallel) using only one channel (for each server).



I don't know if this offers any performance benefits.

+1


source







All Articles