There’s more than one way to do it

2 Mar
14 Aug
Last week, during the prac 2 of CS IB, we were asked to program in Java to build a simple client/server system in which the server takes “commands” from the client and executes them. Due to the time restriction, we were only asked to implement the server, and use telnet to act as client to transact with server. You can have a look here for details.
1 2 3 4 5 | ServerSocket server = new ServerSocket(6666); Socket s= server.accept(); // We now have a client on the end of the socket s BufferedReader in = new BufferedReader( new InputStreamReader( s.getInputStream())); PrintWriter out = new PrintWriter(s.getOutputStream()); |
It’s no more than the knowledge above. Maybe the simplest nextwork program in Java world.
The telnet on lab’s Mac just work well, but after I brought my program to home and run on my own computer, I met a really troublesome problem with the Microsoft’s telnet in Windows XP.
1. First, I started my server.
13 May
传统的网络服务程序,如:ftp、pop和telnet在本质上都是不安全的,因为它们在 网络上用明文传送口令和数据,别有用心的人非常容易就可以截获这些口令和数据。而且,这些服务程序的安全验证方式也是有其弱点的,就是很容易受到"中间人 "(man-in-the-middle)这种方式的攻击。所谓"中间人"的攻击方式,就是"中间人"冒充真正的服务器接收你的传给服务器的数据,然后再 冒充你把数据传给真正的服务器。服务器和你之间的数据传送被"中间人"一转手做了手脚之后,就会出现很严重的问题。
SSH的英文全称是Secure SHell。通过使用SSH,你可以把所有传输的数据进行加密,这样"中间人"这种攻击方式就不可能实现了,而且也能够防止DNS和IP欺骗。还有一个额 外的好处就是传输的数据是经过压缩的,所以可以加快传输的速度。SSH有很多功能,它既可以代替telnet,又可以为ftp、pop、甚至ppp提供一 个安全的"通道"。
Recent Comments