Posted
Filed under Computer/package
detail information :
http://www.cep.kr/blog/cep/193

function upgrade and fix a bug.

I did fix a minor bug from 0.7.7.

I did add few function to kssh. (0.7.12)

You can download kssh.tunnel & sample kssh.cfg file from http://www.cep.kr/blog/cep/193 or http://www.cep.kr/blog/cep/268


"-r" option is directory copy.


$ kssh -h

usage)
scp(put) : kssh [ -r ] id@<hostname|tunnel name>:<src dir/file> <target dir>
                kssh [ -r ] <hostname|tunnel name>:<src dir/file> <target dir>

scp(get) : kssh [ -r ] <src dir/file> id@<hostname|tunnel name>:<target dir>
                kssh [ -r ] <src dir/file> <hostname|tunnel name>:<target dir>

ssh         : kssh id@<hostname|tunnel name> [<command> <cmd options>]
                kssh <hostname|tunnel name> [<command> <cmd options>]

version   : kssh -v
help       : kssh [ -h ]

configure file: kssh.cfg

hostname list)
svn
backup



2011/09/17 04:01 2011/09/17 04:01
[로그인][오픈아이디란?]
Posted
Filed under Computer/package
kssh는 ssh tunnel과 ssh, scp 프로그램을 쉽게 쓰게 만든 스크립트로 초기 버전이다.
이 스크립트는 ssh tunnel을 1개 또는 2개서버까지 하게 해준다.

다운받아 본인의 홈계정에 풀면 ~/bin 이란 디렉토리가 생긴다.
그러면 본인의 home에 있는 ~/bin에 명령어를 실행가능하게 PATH에 다음을 추가해준다.
${HOME}/bin

그리고 나서 ssh config 파일을 수정해준다.
cd ~/bin
vi ssh.cfg
#<name>=<fake port num>=<login node>=<jump node>=<target node>
#  fake port num : 5#### : last 4 digit is whatever
#  login node and jump node format is login_id@hostname
#  target node format is just hostname
#ex)
#test=50000=id@login=id@jump=target
svn=54321=kage@cep= =home

이파일을 본인이 원하는 ssh tunnel용을 모두 등록하면된다.
첫번째 항목은 "이름"
두번째 항목은 "port 번호" 50000 이상을 사용하면됨. 그리고 첫번째 5는 손대지 않고 0000 부분의 숫자만 바꿀수 있다.
세번째 항목은 login 서버의 정보 : id@hostname
네번째 항목은 ssh tunnel을 두번 해야 된다면 처음 로그인후 두번째 건너띌 서버
다섯번째 항목은 최종 로그인 서버

예)
A서버의 kage를 지나 B서버의 kage를 지나 C 서버에 들어가고 싶다고 한다면
test=50000=kage@A=kage@B=C

만약에 A서버의 kage를 지나 C 서버에 들어가고 싶다면
test1=50001=kage@A= =C

로 해주면된다.


ssh tunnel 항목 리스트 및 사용법을 보고 싶다면.. 아래처럼...
$ ssh.tunnel
 
   usage: ssh.tunnel <hostname>
 
you can use kssh at other console after this(ssh.tunnel) command
 
hostname list)
svn
cep
cep2
test
test1

그럼 tunnel을 한다면
$ ssh.tunnel  test
그리고 패스워드를 넣으면 tunnel이 열린다.

그리고나서 다른 창을 띄워서 kssh를 이용해서 scp 또는 ssh를 사용하면된다.

$ kssh
 
usage: kssh <option>  <real command's paramter>
 
   --help: help
   -c : scp ( skip then : ssh )
     -d : directory (scp's options)
          default(skip): file
     -p <put file/dir>: put the file to server
          default(skip) : get mode
   -i : target host's id
   -h : ssh tunnel name
   -v : version
 
configure file: ssh.cfg
 
hostname list)
svn
cep
cep2
test
test1

ssh login)
$ kssh -i root -h test

ls command via ssh)
$ kssh -i root -h test ls

scp from remote(/etc/ssh directory)  to local( 현재 디렉토리) )
$ kssh -c -d -i root -h test /etc/ssh .

scp from remote to local)
$ kssh -c -i root -h test /etc/hosts .

scp from local to remote)
$ kssh -c -p /etc/hosts -i root -h test  /etc

scp from local to remote )
$ kssh -c -d -p /etc/ssh -i root -h test /etc


download :
2009/10/05 10:50 2009/10/05 10:50
[로그인][오픈아이디란?]
Posted
Filed under Computer/Linux
[] 내 laptop에서 a-host를 거처 svn-host에 있는 svn 서버를 이용하고 싶다.
계정은  kage라고 하자.

내 laptop의 터미널 하나에서 다음 처럼 터널을 뚤어준다.

$ ssh -L10022:svn-home:22 -N -t -x kage@a-host
kage@a-host's password: **********

그리고 다른 터미널(at my laptop) 에서
vi .subversion/config 에서 "[tunnel]부분에 다음처럼 넣어준다.
tunnel_ssh = $TUNNEL_SSH  ssh -p 10022

그리고 svn명령어를 내려본다.
$ svn list svn+tunnel_ssh://kage@localhost/svn/test
kage@localhost's password: ********
test/
trunk/


이렇게 하면된다.

[] 같은 방법으로 ssh tunnel을 다음처럼 열어도 된다.
$ ssh -C -L1234:svn-home:22 kage@a-host
(만약에 background로 실행하고 싶다면 -f 옵션을 준다.)
그외 config와 svn 명령어는 같이 사용하면된다.



[] 이제는 두 컴퓨터를 뚤고 지나가보자.
my laptop -> A -> B -> SVN-SRV

ssh tunnel 을 뚤자.
$ ssh -f -L1234:B:22 kage@A 'sleep 10'; ssh -p 1234 -L4321:SVN-SRV:22 kage@localhost

그리고 다른 터미널(at my laptop) 에서
vi .subversion/config 에서 "[tunnel]부분에 다음처럼 넣어준다.
tunnel_ssh = $TUNNEL_SSH  ssh -p 4321

$ svn list svn+tunnel_ssh://kage@localhost/svn/test
kage@localhost's password: ********
test/
trunk/
2009/09/30 00:32 2009/09/30 00:32
[로그인][오픈아이디란?]