
저는 RHEL 5 시스템을 사용 중이며 다른 RHEL 5 시스템에 연결하고 있습니다. 다음 명령을 사용하여 SSH 터널을 만들었습니다.ssh -2 -4 -f -x -N -L 1527:remote_host:1527 user@remote_host
(remote_host는 동일한 서버입니다)
암호를 입력하면 즉시 명령 프롬프트로 돌아갑니다. 나는 빠른 'ps axu | grep ssh'를 실행하여 방금 실행한 ssh 명령에 대한 프로세스를 확인하고 확인합니다.
dashbrd 17861 0.0 0.1 68796 13224 ? Ss 12:44 0:00 ssh -2 -4 -f -x -N -L 1527:remote_host:1527 user@remote_host
내 터널이 성공적으로 설정되었다고 가정합니다.
그런 다음 'telnet remote_host 1527'을 사용하여 테스트했지만 연결에 실패했습니다. 내가 죽이기 전에 몇 분 동안 멈춘다. 로컬 호스트(터널을 설정하는 데 사용한 사용자 이름 포함)의 다른 사용자를 대상으로 텔넷 테스트를 시도했는데 결과는 동일했습니다. 연결이 없습니다.
이 터널의 목적은 Oracle Listener에 연결하는 것입니다. 그래서 나는티핑공익사업; 그것도 연결에 실패합니다. (그렇습니다. tnsnames.ora 파일에 데이터베이스 연결이 올바르게 구성되어 있습니다.)
내가 뭘 잘못했나요?
답변1
Remote_host에 텔넷을 연결하지 않고 localhost에 텔넷을 연결합니다. Remote_host에 직접 텔넷으로 연결할 수 있다면 포트가 필요하지 않습니다.앞으로.
telnet localhost 1527
SSH 매뉴얼 페이지에서:
-L [bind_address:]port:host:hostport Specifies that the given port on the local (client) host is to be forwarded to the given host and port on the remote side. This works by allocating a socket to listen to port on the local side, optionally bound to the specified bind_address. Whenever a con- nection is made to this port, the connection is forwarded over the secure channel, and a connection is made to host port hostport from the remote machine. Port forwardings can also be specified in the configuration file. IPv6 addresses can be spec- ified with an alternative syntax: [bind_address/]port/host/hostport or by enclosing the address in square brackets. Only the superuser can forward privileged ports. By default, the local port is bound in accordance with the GatewayPorts setting. However, an explicit bind_address may be used to bind the connection to a specific address. The bind_address of “localhost” indicates that the listening port be bound for local use only, while an empty address or ‘*’ indicates that the port should be available from all interfaces.