Discussion:
[JSch-users] How to get super permission when using ChannelSftp ?
艾超
2016-02-13 13:50:39 UTC
Permalink
Hello there!
I've been using Jsch for several months on a business project, and I've got this problem:


When using ChannelExec, I can mock a SUDO execution just like in the Jsch examples ( which is using the sudo -S -p '' <command> trick ), it's totally OK and working.
However as to ChannelSftp, I can't find any examples showing how to do a SUDO put/get (when of course, the sftp user on that linux box has super permission and can do sudo ... in the interactive shell ).
Is there a way to do SUDO put/get using ChannelSftp ? if yes, how to do that ? Maybe it needs some modification/extension to Jsch source, but is it possible ?


Any advice will be appreciated, thanks in advance.


Aich,
Best Regards
Lothar Kimmeringer
2016-02-15 12:13:59 UTC
Permalink
Is there a way to do /SUDO put/get/ using ChannelSftp ? if yes,
how to do that ? Maybe it needs some modification/extension to
Jsch source, but is it possible ?
I don't think so. The SFTP subsystem uses no shell and only
supports the SFTP commands being defined by the standard.
AFAIR there is no SUDO-command and SFTP doesn't come with
a site-command as you might know it from FTP, either.


Cheers, Lothar
a1c1
2016-02-17 01:52:52 UTC
Permalink
It's the sftp subsystem in Linux's SSH implementation that blocks the way
to get Sudo permission in sftp. Jsch is merely a re-implementation of SSH
protocol and for compatibility purpose, it just can't do that. The problem
lies in the sftp-server implementation, which is now deployed in nearly
every linux box. You've got a mission impossible, if you insist on doing
SUDO put/get with Jsch ChannelSftp.

------------------------------
Regards
​,​
h
​adoop90
​
Post by Lothar Kimmeringer
Is there a way to do /SUDO put/get/ using ChannelSftp ? if yes,
how to do that ? Maybe it needs some modification/extension to
Jsch source, but is it possible ?
I don't think so. The SFTP subsystem uses no shell and only
supports the SFTP commands being defined by the standard.
AFAIR there is no SUDO-command and SFTP doesn't come with
a site-command as you might know it from FTP, either.
Cheers, Lothar
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
JSch-users mailing list
https://lists.sourceforge.net/lists/listinfo/jsch-users
Loading...