Java Forum / General / June 2007
How to call rsh from Applet to remote host
ashutosh.juneja@gmail.com - 30 May 2007 17:26 GMT Hello,
I am working on a project which will execute a script from Applet on remote host. The applet is displayed in Web interface.
Can any one guide me on the same? Can we do rsh to remote host from applet? Is calling from Applet the right way?
Please let me know if yu need more details?
Thanks in advance Ashutosh
Oliver Wong - 30 May 2007 18:05 GMT > Hello, > [quoted text clipped - 6 lines] > > Please let me know if yu need more details? Unsigned applets have a restriction that they can only communicate with the server they were downloaded from. I don't know the RSH protocol (I'm guessing it's plaintext, similar to the telnet protocol), but if you know it, then the simplest solution would be to host the Applet on the same server you wish to RSH into, and have your applet implement an RSH client and do whatever it is you want to do.
Note, in case you're unaware, that the RSH protocol is not a secure one (everything is sent unencrypted, from what I understand), and that any services that your applet can connect, end-users (and "hackers") can directly connect to as well.
- Oliver
Lew - 30 May 2007 21:42 GMT >> Hello, >> [quoted text clipped - 20 lines] > > - Oliver This fine answer cross-posted to clj.help for the benefit of those trying to follow the multi-posted thread.
To the OP: Please do not multi-post. Cross-post if you must, but even that, well ...
 Signature Lew
Martin Gregorie - 30 May 2007 22:53 GMT >> Hello, >> [quoted text clipped - 18 lines] > services that your applet can connect, end-users (and "hackers") can > directly connect to as well. That's correct - everything is sent as plaintext including passwords. rsh is now deprecated. You should use ssh instead. OpenSSH has OSS ssh clients and interface packages in Java. A look at them could save you quite a bit of time and effort.
http://www.openssh.com/java.html
 Signature martin@ | Martin Gregorie gregorie. | Essex, UK org |
Richard Maher - 31 May 2007 00:52 GMT Hi Martin,
> rsh is now deprecated. Is there a reference for this decree anywhere?
Cheers Richard Maher
> >> Hello, > >> [quoted text clipped - 25 lines] > > http://www.openssh.com/java.html Martin Gregorie - 31 May 2007 12:30 GMT > Hi Martin, > >> rsh is now deprecated. Its still part of some (Fedora for one) Linux distros but its widely regarded as insecure and its use isn't recommended. Given that ssh can do everything rsh can do and will do it securely, there isn't any reason to use rsh.
rsync? Thats a superstructure application and can work over ssh or rsh transport layers.
 Signature martin@ | Martin Gregorie gregorie. | Essex, UK org |
Ashutosh - 31 May 2007 10:54 GMT Hi Martin,
Thanks for the info.
I am checking the link you provided. I will appreciate if you can provide more info in this. Can we use SSH in java applet to execute scripts on remote machines?
Regards Ashutosh On May 31, 2:53 am, Martin Gregorie <mar...@see.sig.for.address> wrote:
> > <ashutosh.jun...@gmail.com> wrote in message > >news:1180542387.831120.23010@x35g2000prf.googlegroups.com... [quoted text clipped - 34 lines] > > - Show quoted text - Martin Gregorie - 31 May 2007 12:40 GMT > Hi Martin, > [quoted text clipped - 3 lines] > provide more info in this. > Can we use SSH in java applet to execute scripts on remote machines? I now use ssh exclusively: I've never used rsh and no longer use telnet. I transfer files with scp, sftp or ftp and use rsync locally over an ssh connection for backups.
So far I haven't needed to use ssh within a Java environment. I spotted the Java implementations a while back when I was trawling the Openssh site for information about hardening sshd. That said, If I have a need to access a remote shell from a Java client the Java ssh implementations would be my first choice for handling the connection.
HTH Martin
 Signature martin@ | Martin Gregorie gregorie. | Essex, UK org |
Richard Maher - 01 Jun 2007 00:16 GMT Hi Martin,
> I transfer files with scp, sftp or ftp and use rsync locally over an ssh > connection for backups. And you security concerns of RSH do not apply to FTP because?
Cheers Richard Maher
> > Hi Martin, > > [quoted text clipped - 16 lines] > HTH > Martin Martin Gregorie - 01 Jun 2007 12:11 GMT > Hi Martin, > >> I transfer files with scp, sftp or ftp and use rsync locally over an ssh >> connection for backups. > > And you security concerns of RSH do not apply to FTP because? I know, I'm lazy sometimes. Also I have yet to see a decent graphical sftp implementation. Most of my file transfers are on my LAN behind my firewall, so safe. The only Internet file transfers I do match the following list:
- most are Fedora upgrades via yum, which uses http or ftp for file transfers: the protocol is outside my control - next most numerous ftp transfers are anonymous via a web browser, so there's little I can do if they choose to use ftp - some are to/from Sourceforge (cvs or ftp): Sourceforge chooses the protocol, not me - a few are updates to my website which is hosted by my ISP, so semi-secure. FTP is my choice here. In the absence of a graphical sftp client I use gftp because I make fewer mistakes that way. - that leaves the rest. Er, there are no others
If you know of a decent graphical sftp client for Linux I'd be grateful for the information.
Regards, Martin
 Signature martin@ | Martin Gregorie gregorie. | Essex, UK org |
Gordon Beaton - 01 Jun 2007 13:51 GMT > If you know of a decent graphical sftp client for Linux I'd be > grateful for the information. Searching for "sftp" on freshmeat.net gives a few relavant hits. This looks like it might be what you're looking for:
http://www.sshtools.com/products/applications/unitty/unitty.jsp
/gordon
--
Gordon Beaton - 01 Jun 2007 13:54 GMT >> If you know of a decent graphical sftp client for Linux I'd be >> grateful for the information. [quoted text clipped - 3 lines] > > http://www.sshtools.com/products/applications/unitty/unitty.jsp Or, getting this back on topic, this Java-based utility:
http://sourceforge.net/projects/j-ftp
/gordon
--
Martin Gregorie - 02 Jun 2007 17:04 GMT >>> If you know of a decent graphical sftp client for Linux I'd be >>> grateful for the information. [quoted text clipped - 6 lines] > > http://sourceforge.net/projects/j-ftp I pulled this down for investigation, but there's something wrong with it: It starts up OK and shows the local directory as I'd expect, but I can't get it to connect anywhere by sftp - just an annoying "Login failure" in its session log window. I know its not a network problem because I can make a connection with the standard sftp utility.
FTP works OK though I don't like the interface as much as I do the gftp utility.
Judging by the amount of tracing and stack dumps that scroll up the console window I started it from I think its still pretty early in the life of j-ftp. Bookmarked, and I'll look at it again in a few months.
 Signature martin@ | Martin Gregorie gregorie. | Essex, UK org |
Martin Gregorie - 02 Jun 2007 16:34 GMT >> If you know of a decent graphical sftp client for Linux I'd be >> grateful for the information. [quoted text clipped - 3 lines] > > http://www.sshtools.com/products/applications/unitty/unitty.jsp Actually, UniTTY is a Java application.
Unfortunately, although the installer downloaded and ran and can find my JDK, its decided that J2SE 1.4.3 isn't good enough for it. Annoyingly, the 3SP website has no clue about system requirements but I've e-mailed them to see what JRE its expecting.
This looks worth following up. Thanks.
 Signature martin@ | Martin Gregorie gregorie. | Essex, UK org |
Richard Maher - 31 May 2007 01:01 GMT Hi Oliver,
> Note, in case you're unaware, that the RSH protocol is not a secure > one (everything is sent unencrypted, from what I understand), and that any > services that your applet can connect, end-users (and "hackers") can > directly connect to as well. I don't know if Ashutosh is in an Intranet or Interenet situation but either way couldn't IPsec or VPNs be of some use here? (If he is dealing with unknown client addresses coming in over the internet then, obviously, I agree with you.)
Cheers Richard Maher
> > Hello, > > [quoted text clipped - 20 lines] > > - Oliver Ashutosh - 31 May 2007 10:45 GMT Hi Richard,
Thanks for the info. I want to use this applet in Intranet i.e within my office network.
My major concern is whether using Applet will serve my purpose. As i have to execute remote scripts in many remote machines and collect and display their result in one Client Applet.
Can this be possible? Is SSH a better option?
Regards, Ashutosh
On May 31, 5:01 am, "Richard Maher" <maher...@hotspamnotmail.com> wrote:
> Hi Oliver, > [quoted text clipped - 39 lines] > > - Show quoted text - Richard Maher - 01 Jun 2007 00:34 GMT Hi Ahutosh,
> I want to use this applet in Intranet i.e within my office network. Ok
> My major concern is whether using Applet will serve my purpose. As i > have to execute remote scripts in many remote machines and collect and > display their result in one Client Applet. I've never done it, but I can see no reason why not. Your Applet will have to be signed if you're connecting to machines other than the "codebase". And some may argue that an alternate design where the client makes a single connection to the server (and it is then the server that makes (or maintains) the numerous connections to the "many remote machines" and packages up the result for the client) may be a better approach. But who knows? Give it a go.
> Is SSH a better option? My take on it is that one's encrypted and the other isn't. If encryption and host authentication is an issue in your intranet then use SSH or IPsec, but I doubt that yours would be the first application to be transmitting data and passwords in-the-clear within the firewalls.
How many clients are you expecting to be running this thing simultaneously? Are you happy with one-process/client on the server?
How many commands will make up a session? Leaving all the links up or disconnecting for each request?
As I said previously, I've never written an Applet that talks RSH (apart from the initial handshake, how hard can it be?) but I have written Applets that talk to the server via TCP/IP sockets and I can assure you they are the Dog's Bollocks!
Cheers Richard Maher
> Hi Richard, > [quoted text clipped - 55 lines] > > > > - Show quoted text -
Free MagazinesGet these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...
|
|
|