-2

-I have opened port 8080 and I can access it with 192.168.1.40 and also no-ip domain -Installed vsftpd -Opened port 80,8080,20,21,22 and 11000-11100

However I can't ssh to it. I have another sever listening on 80 and with same settings ssh works fine.

I appreciate your help.

Edit: I have not touched port 22 for ssh, httpd is listening on port 8080

john206
  • 109
  • 4

2 Answers2

2

What is listening on 8080? That's typically some sort of httpd. For ssh, you'll need to use port 22.

EEAA
  • 108,414
  • 18
  • 172
  • 242
  • yes httpd is listening on 8080, i used ssh user@192.168.1.40 it doesnt work – john206 Mar 20 '12 at 22:38
  • You don't ssh to an httpd. You ssh to an sshd. I believe you're quite confused here. What exactly are you trying to do? – EEAA Mar 20 '12 at 22:40
  • well may be i said it in a confusing way. On my first server, i forwarded my port 80 and linked it to no-ip dns. so i can access my site from example.noip.com and i can ssh to it using ssh user@example.noip.com. On my second server, since I can't forward port 80 to other ip address, I opened port 8080. so in httpd.conf, i have Listen:8080, so now I can access website two like example2.noip.com:8080 . Then I want to ssh to second server using ssh but I don't know how. – john206 Mar 20 '12 at 22:44
  • Well, you'll need to forward another port to 22 on the second server, say `2222` for example. Then from outside, you'd ssh via `$ ssh -p2222 user@example2.noip.com`. – EEAA Mar 20 '12 at 22:49
  • could you please tell me how to forward port 2222 to 22? Which file should I modify? Vsftpd and iptables? If you also have link that puts me on the right path would be great. Thanks for your patience ErikA – john206 Mar 20 '12 at 22:53
  • John, that is really beyond the scope of this site. This will need to be done in your router - just google it. I'm sure someone has instructions on there for your particular model. – EEAA Mar 20 '12 at 22:55
1

You will have to use another port for ssh on the second server as well. Pick one and forward that. Like if you choose port 23 then you forward port 23 to the second server and connect to

ssh -p23 user@example.noip.com

  • I open port 23 by editing sshd_config, restarted sshd, add 23 to iptables, forwarded port 23 on router and still no luck :( – john206 Mar 20 '12 at 23:14
  • Can you access it from your LAN? – Andreas Hagen Mar 21 '12 at 23:12
  • No unfortunately I can't, I'm able to access via ftp tho. I changed the port in sshd config and restarted it, still I get the message, connection was refused from port 23 – john206 Mar 22 '12 at 02:16
  • Have you disabled your firewall, or opened port 23 in it? – Andreas Hagen Mar 22 '12 at 07:48
  • yes I have opened port 23, I edited iptables like this:-A INPUT -m state --state NEW -m tcp -p tcp --dport 23 -j ACCEPT and restart iptables – john206 Mar 22 '12 at 16:47
  • Seams about right, but double check with nmap. This thread describes how: http://serverfault.com/questions/115063/nmap-check-if-port-80-and-8080-is-open Also, is it inaccessible if you try to access it with itself (localhost)? – Andreas Hagen Mar 22 '12 at 20:30
  • Thanks for me helping me out. I ran nmap said 23/tcp status:closed sevice:telnet so I installed telnet-server and start it. now nmap says status:open but when I ssh, it doesn't say connection refused however it gets stuck. – john206 Mar 23 '12 at 21:35
  • Well, you do not need the telnet server, in fact you will need to uninstall it. Port 23 is usually used for telnet and that's why nmap listed it as so. What you want i a SSH server running on that port instead. So uninstall telnet, and since nmap originally said it was closed you probably had not installed the SSHd correctly, so try to re-install it :) – Andreas Hagen Mar 24 '12 at 01:10
  • Of course you could also just use telnet instead of SSH. It gives you the same functionality, mostly, but lacks the extra security overhead. To connect to the telnet server you will need a telnet client. If you are accessing the server from a Windows machine, putty is a solid choice. Linux (and Mac OSX as well i think) usually has the command telnet pre-installed to use as a client. – Andreas Hagen Mar 24 '12 at 01:13
  • Forgive me for being a newbie sometime.I have a good news! I removed telnet and reinstalled openssh-server. I still had no luck with port 23 so I went with a new one and it worked :) Thanks a billion, you might wanna edit your answer with your last comment – john206 Mar 24 '12 at 04:43