Posted
Filed under Computer/Linux
Create ssh-key
[root@localhost ]# ssh-keygen -t rsa

Copy to authorized_keys
[root@localhost ]# cp -a ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
[root@localhost ]# ls -l ~/.ssh/
total 16
-rw-r--r-- 1 root root  408 Jun  4 16:44 authorized_keys
-rw------- 1 root root 1675 Jun  4 16:43 id_rsa
-rw-r--r-- 1 root root  408 Jun  4 16:43 id_rsa.pub
-rw-r--r-- 1 root root  391 Jun  4 16:44 known_hosts

password-less ssh login test
[root@localhost ]# ssh localhost
Warning: Permanently added 'localhost' (RSA) to the list of known hosts.
root@localhost's password:


check like this
[root@localhost ]# stat -c "%a %u %g" /root
550 0 0
This value is correct information

if different value then can login with password-less ssh. (For root account)
example)
permission is 775, 777 or 755 ...
owner is application or normal user account

permission and owner is different then can’t login to root account with ssh-key

[root@localhost ]# chmod 550 /root
[root@localhost ]# chown root:root -R /root

Then will be works.
2014/06/05 06:07 2014/06/05 06:07
[로그인][오픈아이디란?]
Posted
Filed under Computer/package
support MAC OSX 10.8


$ kssh -h

kssh [<option>] [<id1>@<host1> [<id2>@<host2>] ] <id>@<dest host>

 -t     : make a tunnel
 -k     : kill connection
 -l     : show connection list
 -lc    : show configuration list (it need kssh.cfg file)
 -v     : show version

* scp
kssh [<option>] <src> <id>@<dest host>:
kssh [<option>] <id>@<dest host>:<src> .
 -r     : scp's directory copy option

* ssh
kssh <id>@<dest host> [<cmd> <cmd's option>]

kssh.cfg format
-----------------------------------------------------------
# ~~~ : comment
# single host
<name1>=<old format>=<id1>@<host1>= =<dest node>
# dual host
<name1>=<old format>=<id1>@<host1>=<id2>@<host2>=<dest node>
....
-----------------------------------------------------------


Install
1. extract kssh.1.2.19.tgz to your bin directory
2. make a kssh.cfg file in same kssh file's path.
3. vi kssh.cfg
# single host for tunnel
dest1= =kage@test1= =dest1
# dual host for tunnel
dest2= =kage@test1=kage@test2=dest2

* show list
kssh -lc

* first time connect to dest1
kssh root@dest1
<enter kage@test1's password>
<press key "control + ad" for exit screen mode>
<enter root@dest1's password>
 
* second time connect to dest1 ( after got a tunnel )
kssh root@dest1
<enter root@dest1's password>


2013/02/09 07:39 2013/02/09 07:39
[로그인][오픈아이디란?]
Posted
Filed under Computer/package
detail information :
http://www.cep.kr/blog/cep/193

upgraded many function.
So, I is working on single shell file.
almost same function.
but it is working without kssh.cfg file.
also, with kssh.cfg file.

"-r" option is directory copy.


$ kssh -h

kssh [<option>] [<id1>@<host1> [<id2>@<host2>] ] <id>@<dest host>

 -t     : make a tunnel
 -k     : kill connection
 -l     : show connection list
 -lc    : show configuration list (it need kssh.cfg file)
 -v     : show version

* scp
kssh [<option>] <src> <id>@<dest host>:
kssh [<option>] <id>@<dest host>:<src> .
 -r     : scp's directory copy option

* ssh
kssh <id>@<dest host> [<cmd> <cmd's option>]

kssh.cfg format
-----------------------------------------------------------
# ~~~ : comment
<name1>=<old format>=<id1>@<host1>=<id2>@<host2>=<dest node>
....
-----------------------------------------------------------
2012/10/26 08:20 2012/10/26 08:20
[로그인][오픈아이디란?]
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
[로그인][오픈아이디란?]