Monday, September 22, 2008

Using sharpSSH (C#) to write/customize your own sshclient

or even winscp (open source), or putty (is it possible?)

I was trying to do many investigations on SSH protocol, or some tools/ways like JRE. The purpose to do a remote command-line, and file transfer on all platforms: Windows, Linux, Unix, etc.

1. The first approach is to implement JRE application, but we need to maintain it by the time

2. Try to implement again with C# (and Mono) stupid way

3. Try to implement sharpSSH

Actually, I knew many way/tools to do that, but by the time, i forgot. Now, i'm going back. And i was tried PUTTY command-line family, and it was so impressive

Beside doing: compatibility test, between SSH protocol version, we need to do some test for sheel specification stuff (windows shell, cmd.exe, command.exe, bash, csh shell, etc.) convention between Windows, Linux

plink, pscp, psftp, so great! to do file transfer and remote command-line

That i was told about "client-side"

And here is server-side, for Unix, we used OS-standard, default sshd packages. But on Windows we used openSSH package, or copssh, the reason is, sometime sharpSsh cannot work with openSSH but copssh

Process special character like "\", "/", """, "'", "\\"

We are thinking about Cygwin as Linux env. for another linux-like ssh server

XDMP (X-Window protocol) for remoting export GUI on Unix/Linux

If you want to launch (export) a Unix/Linux GUI program on Windows or other Unix/Linux OS

First of all, on the local Unix/Linux, we need to "export" an environment variable "DISPLAY" to your destination host and the port number, eg:
# export DISPLAY=172.16.49.86:0.0

Then of the remote OS (destination), where you want to host your GUI program, you need to install an XDMP Server (eg: xming, Xmanager)

This is basic idea, you can google more information, I will add detail later. Don't forget to turn off any virus scanner programs, firewall

Automation Testing experience

if you want to build your own Automation Testing (Framework). Below is my experience:

- Don't ever fall into situation: test "automation testing tools". Yeap, it is absolutely, this is a loop forever. You build a tools to do the test, and you need to test your tools, does it make sense?
So, please use any available to adapt your requirement, save time, effort, and don't have to "test your test tools"

Working directory in Solaris - /export/home

The reason I mention about this is some of us, usually put too much data into /root, but this folder is mounted for system working only. So if disk slices get full, your system couldn't do anything

And, by default, /export/home is the place for you to put any, as much data as you want, without any corruptions to system working directory

Solaris basic command-line

Một số lệnh cơ bản của Solaris, (kể cả sữ dụng được cho Unix/Linux khác)

- init

Giải thích: Unix, Linux, có nhiều cấp độ vận hành hệ thống, thường từ, 0-5, mỗi cấp độ được sữ dụng cho mục đích khác nhau. Và đây cũng là lý do, bạn có thể cấu hình cho một service của mình chạy được ở cấp độ nào.

Cấp độ thấp nhất: 0, khi máy mới khởi động, cấp độ 3, thường là console với những services cơ bản đã được cấu hình (eg: network), cấp độ 5, bao gồm giao diện đồ họa

Mẹo:
- Bạn có thể thiết lập hệ thống mặc định khởi động ở bất kỳ cấp độ nào bạn muốn (dùng trong trường hợp bạn không muốn sữ dụng đồ họa, muốn hệ thống khởi động nhanh)
- Bạn có thể reset hệ thống bằng cách đưa về cấp độ thấp nhất (0), hoặc đưa về cấp độ thấp (3) sau đó khởi động lại cấp độ cao (5) để reset một số services (đồ họa) ở cấp độ 5
- Đưa về 1, và đưa lên >3, để reset network

Tham khảo: chi tiết về chức năng của các cấp độ



- bash: if you're familiar with bash shell, it makes you happy, use this command to change the shell

- gunzip -d .gz file

- tar xvf .tar file

Permit Solaris SSH root login

Here after I will use Vietnamese for this stuff, the reason, there are so many English articles, and I would share this to Vietnamese community. And I will do the same for all other stuffs

Theo mặc định khi bạn cài Solaris, có chọn cài đặt SSH, thì Solaris sẽ được cấu hình bảo mật, không cho phép bạn đang nhập từ xa vào SSH protocol bằng quyền root. Để làm được việc này bạn phải vào:
- /etc/ssh/sshd_config, tìm đến dòng, "PermitRootLogin" và thay đổi tham số từ "no" sang "yes"
- khởi động lại sshd service

Digital Inspiration Technology Guide

Change the world with your passion