Right, this is a complicated one.
I'm running a server, which I would like multiple types of clients to connect to. That part I've got more or less figured out.
The part I havn't however, is how I can write it so that SSH clients can connect to it.
I'm not even entirely sure what SSH is to be honest. I know that it uses certificates, and encryption to make it more difficult to intercept communications, but beyond that I'm not really sure.
Now I've seen that there's lots of SSH clients for Java, and I've seen that there's a few APIs, but a lot of them cost money.
What would be really helpful are some SSH server writting tutorials.
jsalonen | Mon, 02 Jul 2007 19:59:00 GMT |
You know, I'm actually not sure if it would or not. I'm thinking probably?
The thing is, receiving the information is just the first step in a very complex process.
After recieving a String, it takes the first word, and compares that to a list of commands. It then takes the rest of the string and runs it through an appropriate parser for that command, and then sends that information back.
laughingman | Mon, 02 Jul 2007 19:59:00 GMT |
SSH, "secure shell", is a collection of networking tools that work over a secure, encrypted connection. It's often used when logging in to a different computer on the network so on one else can get your password or any other data that travels between your computer and your server.
It sounds like instead of SSH you want SSL (secure sockets layer) which is a lower level thing. SSL sockets are a part of the standard Java API, see package javax.net.ssl. I haven't used it by javaalmanac.com has these hopefully helpful examples:
http://www.javaalmanac.com/egs/javax.net.ssl/pkg.html
jsalonen | Mon, 02 Jul 2007 19:59:00 GMT |
Yeah, like I said, I don't really understand what SSH really is. Does SSH use SSL for it to transer information?
Are there a lot of Telnet like SSL clients? One of the reasons why I was going to write the server to allow SSH clients to connect to it was because there's quite a few of them out there, and it seems like it's fairly secure.
That, and I want to learn how I can actually write this stuff. (Even if it turns out later there's better options).
laughingman | Mon, 02 Jul 2007 19:59:00 GMT |
SSH is Secure Shell, which you can use to log on into a Unix/Linux machine remotely but securely. (The alternative is rlogin). You just type in the command ssh username...machine, then the machine gives you its public key (which you can store into a database), then you're asked for your password and you can issue commands as if you were on the other machine.
What are you trying to make your server do? If you haven't heard of SSH before, then it likely isn't SSH. You can use a secure socket to encrypt communication, or just use a normal socket if you don't need that. A good place to start is http://java.sun.com/docs/books/tutorial/networking/ , although that doesn't talk about secure sockets.
matei | Mon, 02 Jul 2007 19:59:00 GMT |
bandari | Mon, 02 Jul 2007 19:59:00 GMT |
I've been using SSH for about 3 years, mostly to get access to the college computer. I understand what it is, and what it's used for, but not how it works.
I'm mostly interested in doing Encryption here. I figure there's quite a few good SSH clients out there, may as well use those.
Most people will probably be logging onto this with Telnet clients. And it's going to be a large varity of Telnet clients too. It won't be any one particular client people will be using.
Most of you probably know what a MUD is. Well this is going to be quite similar to that.
laughingman | Mon, 02 Jul 2007 19:59:00 GMT |
yatarchivist | Mon, 02 Jul 2007 19:59:00 GMT |
laughingman | Mon, 02 Jul 2007 19:59:00 GMT |
Hi,
SSH is for secured data transfer.SSL is used for secured web sessions like https. SSH is used for secured login also. In SSH you generate public and private key. The private key is stored in the server and the pubic key is used to encrpt the user data and send it across. Clients connect to the user using the username and password provided by the server administrator and for additional security you can provide a pass phrase. Once the secured connection is established , data transfer can take place using the secured link via tools like sftp(secured FTP) . For learning use F-Secure as your SSH server which I guess you can download a trial version and use openSSH for java client. But if you want to do in production environment I would suggest dont use openSSH as your SSHclient. OpenSSH has problems transferring big files. It works well for small transfers and its outdated as they have a commerical version of it which is maverick and is very expensive. I tried to find a cheaper client but with little success.
hope this helps you.
regards
shyam
gshyam_reddy | Mon, 02 Jul 2007 19:59:00 GMT |
> And it's going to be a large varity of Telnet clients too.
I take it by this you are also after colours/simple ASCII graphics. Then it is likly you will want to search your local friendly RFC database for telnet. This is done with exscape codes. Or search you "java curses" for some implementations.
> Most people will probably be logging onto this with
> Telnet clients. And it's going to be a large varity of
If you want standard TELNET clients to work, then you can not use SSL.
SSH is based on SSL. However, if you are after writing a SSH server in Java, I think you will in for a hard job. A few clients exist that you could base your implementation on. (Google Java SSH
A simpler way do to it might be to have a normal UNIX logon, with the SHELL set your application.
Finally, I think is patent-encombered(sp), you might need to pull out the check book if you want to be selling this. Check out http://www.ssh.com.
mlk | Mon, 02 Jul 2007 19:59:00 GMT |
>I take it by this you are also after colours/simple ASCII graphics. Then it is likly you will want to search your local friendly RFC database for telnet. This is done with exscape codes. Or search you "java curses" for some implementations.
Earlier along as I was working on this, someone suggested the RFC for Telnet. I wanted to find a way to deal with clients that disconnected in an uncontrolled way. So I send it No operation signals every so often.
>If you want standard TELNET clients to work, then you can not use SSL.
SSH is based on SSL. However, if you are after writing a SSH server in Java, I think you will in for a hard job. A few clients exist that you could base your implementation on. (Google Java SSH
Already found a few, when I was looking for server code. I also found this link which suggested that SSL and SSH are quite different? http://www.rpatrick.com/tech/ssh-ssl/
>A simpler way do to it might be to have a normal UNIX logon, with the SHELL set your application.
That might work. It could certianly be much better for security purposes. But like I said, I'm interested in making something that's cross platform.
>Finally, I think is patent-encombered(sp), you might need to pull out the check book if you want to be selling this. Check out http://www.ssh.com.
Well, that would certianly be a big problem, as I am thinking of selling this. It'd certianly be a good reason to look into other methods of securing data. I am planning on writting a custom client, I might just have to force people to use that (or write their own).
Thanks for the advice, you might have saved me a lot of time, possibly jail (I probably would have gone to see a lawyer before any trials to be fair :P)
laughingman | Mon, 02 Jul 2007 19:59:00 GMT |
determen | Mon, 02 Jul 2007 19:59:00 GMT |
jakessa | Mon, 02 Jul 2007 19:59:00 GMT |
ianschneider | Mon, 02 Jul 2007 19:59:00 GMT |
the following is my codes:String gbStr = new String(s_content.getBytes(),"ISO_8859_1");but sometimes it throws exception like this:java.nio.BufferOverflowExceptionat java.nio.charset.CoderResult.throwException(CoderResult.java:259)at ...
what is the meaning of java is platform independent ? is it just because of java code can be run in windows/linux/unix platform ? but then C/C++ also can be run in windows/linux/unix . so why those are not called platform independent ?why java is called platform independent ? ...
So, I've been doing alot more code on the file-level and have been noticing that Java is really terrible at deleting files. This should be rather straightforward, but the delete method can fail in so many ways, it's unbelievable. Even with taking special care to close all streams, it will ...
I have been following these forums for a little while now. I was looking at one that used a StringBuffer to build strings instead of ...String out = "";out += "Another String...".. etc. I decided I would do a test. I know this may be stupid but I never even considered using a buffer. I was ...
Just like the title says. It's gone. I need to develop for 1.1.8 and its a lot harder without the API. The replacement page (http://java.sun.com/products/jdk/1.1/index.html) says to go to some other page to get it, but it's not there I've looked a bunch of times.So... anyone know where an ...
Please help!I run an Applet wrapped up in an appropriate .jnlp file under the Java WebStart environment on MS Windows 2k. Everything works fine, except that the WebStart-Applet window (lower border) is always positioned at the bottom of the desktop screen and overlayed by the MS Windows ...
Good evening,does anybody know an OCR-API (optical character recognition or so..) for recognizing text from pictures? I need to search for special strings in pictures.greetingsTobias ...
hi I want to give the JCP exam. i want the comlete info about the exam. can i give direct j2me exam or first i have to pass the core java exam? Is it neccessary to give papers sequencially? please if any one having idea then tell me...Thanks...
I have an applet that communicates with a servlet. When I try to get the input stream of the connection I opened from applet to servlet I get this error:java.io.EOFExceptionat java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2165)at ...
Hello, is there anyone to help me? I'm trying to send the pcl's version that i'm using to the printer , but I don't know the way to do this. Actually i'm using pcl5 but the printer has been installed as pcl6. When I send to this printer the command in pcl5 to select the paper orientation ...
Hello,I have two questions related to profiling.1. Is there a detailed description available on analysing profiling data ouput by the java program? Please give me the sources. Preferably free sources on the net.2. When I start my program with the command ..java -Xrunhprof:cpu=times ...
Hi All,Here in my project i need to print the contents of a .txt file to the printer.I am using a dotmatrix printer and i am going to print the contents in the 130 column paper.So try to use javax.print packagewhen i compile the program i am getting an error:-package javax.print does not ...
Hi I am having problem encoding Strings with UTF-16 which writes a ByteOrdermark at the start of the data. The problem is that is also writes a series of nulls at the end of the data,does this charset work.The following program encodes the String 'test' it then prints out as a String with the ...
Hi all,How do I send to a printer installed on a server some especial characters? I need to send that ESC/P commands to an Epson printer installed at a server. How do I send, using Java (dos mode), and ESC + M command to the printer?I'd appreciate a help on that ...
i can use the JPS to print to a device, but the attributes for LANDSCAPE and COPIES are ignored, although I can print copies in landscape to the device outside of JPS using other tools (e.g. Word).Code:DocFlavor myFormat = DocFlavor.INPUT_STREAM.AUTOSENSE;Doc myDoc = new SimpleDoc(textStream, ...