켈프에더 올렸던 글인데 여기도 포워딩 해봅니다 .
다른 장소에 팔아먹은 임베디드 장비가 내부 아이피를 사용하고 그 장소에 특정 서버를 설치할 여력이 없기에 생각해낸것이
ssh reserve tunnel 이였습니다. 그런데 이짓을 할려면 ssh 는 물론이고 타켓에 sshd까지 올려야 한답니다.
ssh 는 잘 됐는데 -_-;; sshd 올리는게 문제네요.. 컴파일이야 잘 된거 같은데.. 대략 환경 설정으로 난감하네요 OTL.
음 그런데 무엇이 문제인지 로긴 성공 이후 바로 커넥션이 끊어져 버리네요 -_-;
무슨 환경 설정이 부족한건지 도무지 알 길이 없습니다 OTL..
===========================
데스크탑 로그
--------------------------------------------------
linuxmc@mc:/$ ssh
[email protected]
The authenticity of host '192.168.1.139 (192.168.1.139)' can't be established.
RSA key fingerprint is ef:70:64:83:2f:00:86:ce:ed:84:b2:b5:eb:27:b3:86.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.139' (RSA) to the list of known hosts.
[email protected]'s password:
debug1: permanently_set_uid: 0/0
Last login: Fri Jan 2 03:38:07 1970 from 192.168.1.202
WARNING: Your password has expired.
You must change your password now and login again!
Changing password for root
Enter the new password (minimum of 5, maximum of 8 characters)
Please use a combination of upper and lower case letters and numbers.
Enter new password:
Re-enter new password:
Password changed.
Connection to 192.168.1.139 closed.
===================================
====================
타켓 서버 로그
---------------------------
debug1: sshd version OpenSSH_4.6p1
debug1: private host key: #0 type 0 RSA1
debug1: read PEM private key done: type RSA
debug1: private host key: #1 type 1 RSA
debug1: read PEM private key done: type DSA
debug1: private host key: #2 type 2 DSA
debug1: rexec_argv[0]='/rfid/ssh/sbin/sshd'
debug1: rexec_argv[1]='-d'
socket: Address family not supported by protocol
debug1: Bind to port 22 on 0.0.0.0.
Server listening on 0.0.0.0 port 22.
Generating 768 bit RSA key.
RSA key generation complete.
debug1: Server will not fork when running in debugging mode.
debug1: rexec start in 4 out 4 newsock 4 pipe -1 sock 7
debug1: inetd sockets after dupping: 3, 3
Connection from 192.168.1.202 port 45073
debug1: Client protocol version 2.0; client software version OpenSSH_4.3p2 Debian-8ubuntu1
debug1: match: OpenSSH_4.3p2 Debian-8ubuntu1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-1.99-OpenSSH_4.6
debug1: list_hostkey_types: ssh-rsa,ssh-dss
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST received
debug1: SSH2_MSG_KEX_DH_GEX_GROUP sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_INIT
debug1: SSH2_MSG_KEX_DH_GEX_REPLY sent
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: KEX done
debug1: userauth-request for user root service ssh-connection method none
debug1: attempt 0 failures 0
Failed none for root from 192.168.1.202 port 45073 ssh2
debug1: userauth-request for user root service ssh-connection method password
debug1: attempt 1 failures 1
User root password has expired (root forced)
Accepted password for root from 192.168.1.202 port 45073 ssh2
debug1: Entering interactive session for SSH2.
debug1: server_init_dispatch_20
debug1: server_input_channel_open: ctype session rchan 0 win 65536 max 16384
debug1: input_session_request
debug1: channel 0: new [server-session]
debug1: session_new: init
debug1: session_new: session 0
debug1: session_open: channel 0
debug1: session_open: session 0: link with channel 0
debug1: server_input_channel_open: confirm session
debug1: server_input_channel_req: channel 0 request pty-req reply 0
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req pty-req
debug1: Allocating pty.
debug1: session_pty_req: session 0 alloc /dev/pts/0
debug1: server_input_channel_req: channel 0 request env reply 0
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req env
debug1: server_input_channel_req: channel 0 request shell reply 0
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req shell
debug1: Setting controlling tty using TIOCSCTTY.
Jan 2 04:01:30 passwd[1244]: password for `root' changed by user `root'
debug1: Received SIGCHLD.
debug1: session_by_pid: pid 1244
debug1: session_exit_message: session 0 channel 0 pid 1244
debug1: session_exit_message: release channel 0
debug1: session_pty_cleanup: session 0 release /dev/pts/0
debug1: session_by_channel: session 0 channel 0
debug1: session_close_by_channel: channel 0 child 0
debug1: session_close: session 0 pid 0
debug1: channel 0: free: server-session, nchannels 1
Connection closed by 192.168.1.202
debug1: do_cleanup
Closing connection to 192.168.1.202
===============================
혹시 무엇인지 아시는 분은 내공좀 나누어 주세요
이것만 마무리 되면 ssh reserve tunnel 이 완성되는데 아흐.. 쩝쩝쩝.