Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6003257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:05:45+00:00 2026-05-23T01:05:45+00:00

Can someone tell me the differences between ChannelExec & ChannelShell ?

  • 0

Can someone tell me the differences betweenChannelExec & ChannelShell?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T01:05:46+00:00Added an answer on May 23, 2026 at 1:05 am

    The shell and exec channels are quite similar – both execute commands with the remote shell (at least, conceptually – the server might be configured to treat them differently, of course). RFC 4254 groups them in the section "Interactive Sessions", and they both (as well as subsystem, see below) use the channel type "session" in the SSH protocol.

    There is one important difference:

    • For ChannelShell, the input stream provides both the commands and input to these commands. This is like using an interactive shell on your local computer. (And it is normally used just for that: interactive use.)

    • For ChannelExec, the commands are given with setCommand() before connect(), and the input stream will be forwarded to these commands as input. (Most often, you will have only one command, but you can provide multiple ones using the normal shell separators &, &&, |, ||, ;, newline, and compound commands.) This is like executing a shell script on your local computer. (Of course, if one of the commands itself is an interactive shell, this will behave like a ChannelShell.)

    • There is a third similar one, ChannelSubsystem, which executes a subsystem of the ssh server – here the server’s configuration decides what to do, not the remote user’s shell. (The most often used subsystem is sftp, but for this JSch provides a specialized channel, which understands the protocol.)

    Note that what I call "input stream" here is the stream of data in the channel from the local to the remote host – that can be actually be done by passing a Java InputStream to the setInputStream method, or by getting a Java OutputStream from the getOutputStream method and writing to it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone tell me some differences between applications and applets?
Can someone tell me some differences between applications and applets?
Can someone tell me the different between LinkButton.PostBackUrl and HyperLink.NavigateUrl? I've got a asp.net
Can someone tell me the difference between: $(document).ready(function() { }); and: var someVar =
Can someone tell me the difference between <bean id=b1 class= /> <bean id= class=>
can someone tell me what the difference between assigning event handlers using bind(): $(function
Can someone tell me what is the difference between active and passive FTP? Which
can someone tell the difference between objective C's self and C++ this pointer?
can someone tell me what the difference is between [(id)Object class] and object_getClassName(id Object)
Can someone tell me the exact difference between mobile agents and web crawlers? Thanks

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.