Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm in the university, trying to logging to ssh to a server that has ssh working outside the university network, but I can't login. How do I know if ssh is enable or not?

But I know that server is not configured correctly. so in order to remove some uncertainty. I want to know if there is a command to check if University has blocked ssh or not.

share|improve this question

closed as off-topic by EEAA, sciurus, ceejayoz, mdpc, Falcon Momot Jan 15 at 5:24

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must be relevant to professional system administration. Server Fault is dedicated to professional system and network administrators. End user and enthusiast questions are off-topic (contact your system administrator or hire a professional to help you out). Please see the Help Center for more information." – EEAA, sciurus, ceejayoz, mdpc, Falcon Momot
If this question can be reworded to fit the rules in the help center, please edit the question.

    
Try ssh'ing from another source network or to a different exernal host? E.g.: ssh -vT git@github.com –  dmourati Jan 14 at 23:45
    
Try asking your university IT department! –  mdpc Jan 15 at 3:01

1 Answer 1

A simple test would be to telnet $ssh-host $ssh-port. You should see something like the following almost immediately if it worked:

$ telnet sshserver.example.com ssh Trying 1.2.3.4... Connected to sshserver.example.com. Escape character is '^]'. SSH-2.0-OpenSSH_5.1p1 Debian-5

If it takes a while or you get an abrupt failure then it is either not running on the remote server, or you got the port wrong, or it is blocked somewhere between the shell you're running and the remote sshd.

Update based on your answers: The problem is probably not your university network. Most likely (hopefully) you have something sitting between your home desktop and your ISP (ie your router or WiFi AP etc). That device does not know that you want to allow the inbound SSH connections from the internet. You want to: 1 add a TCP forwarding rule to route an inbound TCP port to a pre-defined destination (your desktop's IP address at port 22). I strongly suggest you pick a big number (larger than 1024 but smaller than 65535) as the port. Your rule will look something like "forward from inbound port 3299 to desk_top_ip port 22" 2 When you are not at home and using your laptop you will have to ssh to your public IP address (not the same as your desktop IP address). You can find your public IP most easily by going to a site like http://whatismyipaddress.com/. It probably doesn't change very often. 3 When you are not at home and using your laptop you will have to ssh to the TCP port you specified above (not the default ssh port of 22). So your ssh command, if you use a command line, would look like ssh my_user_name@my_public_ip_at_home -p 3288

enjoy

share|improve this answer
    
Judging from your answer it means there is no direct command to check if ssh is enabled in the network I'm currently in. Say (McDonlads wifi network). But thanks for the commands. Learned a new thing –  Suhaib Jan 14 at 23:34
    
There is a direct way. The direct way to do it is to inspect the router and firewall configurations that are managed by your university and ISP. Do you prefer the direct way or the easy way :) –  Ram Jan 14 at 23:38
    
lol, ofcourse easy way. But problem is, My server can accept ssh locally but I can't ssh externally. When I asked in superuser they told me its the ISP that has disabled ssh feature for me. When I called them they said they didn't. Now the only place I have access to internet is the University. And since I can't ssh from Uni. I'm confused between 3 things. my ISP is lying, Uni disabled ssh, or my server is not configured correctly. –  Suhaib Jan 14 at 23:43
    
I don't know what you mean by this: "My server can accept ssh locally but I can't ssh externally". Do you control the SSH server? Can you ever connect to the SSH server (meaning from a network other than your university)? –  Ram Jan 14 at 23:44
    
I mean, When I'm home. I can ssh from my laptop to my desktop. But when I go to the University. I can't ssh to my desktop. Sorry if I was confusing –  Suhaib Jan 15 at 1:20

Not the answer you're looking for? Browse other questions tagged or ask your own question.