반응형
[ERROR] 18-02-27 10:34:19 : [main]commons.SftpUtil : com.jcraft.jsch.JSchException: java.net.ConnectException: 연결
com.jcraft.jsch.JSchException: java.net.ConnectException: 연결 시간 초과
at com.jcraft.jsch.Util.createSocket(Util.java:349)
at com.jcraft.jsch.Session.connect(Session.java:215)
at com.jcraft.jsch.Session.connect(Session.java:183)
at com.eunbi.collector.commons.SftpUtil.init(SftpUtil.java:40)
at com.eunbi.collector.worker.CollectorWorker.init(CollectorWorker.java:264)
at com.eunbi.collector.worker.CollectorWorker.run(CollectorWorker.java:41)
at com.eunbi.collector.manager.CollectorManager.run(CollectorManager.java:32)
at com.eunbi.collector.CollectorMain.main(CollectorLbsaMain.java:22)
Caused by: java.net.ConnectException: 연결 시간 초과
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at java.net.Socket.<init>(Socket.java:434)
at java.net.Socket.<init>(Socket.java:211)
at com.jcraft.jsch.Util.createSocket(Util.java:343)
... 7 more
자바 jar파일이 접속이 안되길래 파보았다.
* SSH 접속불가
[spot@eunbi-2 bin]$ ssh spot@eunbi-app -p22
ssh: connect to host eunbi-app port 22: Connection refused
* 키는 이미 교환되어있음
[spot@eunbi-2 bin]$ ssh eunbi-app
spot@eunbi-app's password:
Last login: Tue Feb 27 10:21:31 2018 from eunbi-2
* 방화벽 해제상태
[spot@eunbi-app ~]$ service firewalld status
Redirecting to /bin/systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
차이점을 보면 포트를 지정해준 것은 로그인에 실패했다.
결론적으로 ssh 포트설정이 다르다는 것인데
*참고*
http://goguri.tistory.com/entry/Linux-ssh-port-%EB%B3%80%EA%B2%BD
[spot@eunbi-app ~]$ sudo vi /etc/ssh/sshd_config
# If you want to change the port on a SELinux system, you have to tell
# SELinux about this change.
# semanage port -a -t ssh_port_t -p tcp #PORTNUMBER
#
#Port 22
Port 2222
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
포트가 22가 아닌 2222가 되어있는걸 확인 가능하다.
[spot@eunbi-2 bin]$ ssh spot@eunbi-app -p2222
Last login: Tue Feb 27 10:21:31 2018 from eunbi-2
반응형
'Develope > LINUX' 카테고리의 다른 글
kafka console 명령어 모음 (0) | 2022.04.13 |
---|---|
[Tomcat] 설정 Tip (0) | 2018.11.27 |
[shell script] 프로세스 실행 체크 스크립트 (0) | 2018.01.08 |
[Shell Script, Mysql] mysql -e 명령어 시 결과 억지로 출력하기 (wc -l / -Bse) (2) | 2017.11.22 |
[Linux] Cron 이 안될 때, 실행은 되는데 결과가 이상할 때, 실행도 안될 떄; (0) | 2017.11.16 |