How to call rsh from Applet to remote host

A

ashutosh.juneja

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
 
O

Oliver Wong

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?

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
 
L

Lew

Oliver said:
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

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 ...
 
M

Martin Gregorie

Oliver said:
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.
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
 
R

Richard Maher

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
 
A

Ashutosh

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
 
A

Ashutosh

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
 
M

Martin Gregorie

Richard said:
Hi Martin,
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.
 
M

Martin Gregorie

Ashutosh said:
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?
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
 
R

Richard Maher

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
 
R

Richard Maher

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
 
M

Martin Gregorie

Richard said:
Hi Martin,


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
 
M

Martin Gregorie

Gordon said:
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
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.
 
M

Martin Gregorie

Gordon said:
Or, getting this back on topic, this Java-based utility:

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top