Jump to content

Troubles connecting to my account via SSH


Recommended Posts

Hello..

 

I'm following the steps on this page:

http://service.futurequest.net/index.php?_a=knowledgebase&_j=questiondetails&_i=539

 

If I try this line:

 

ssh -l username host.com

 

I get this error and don't know what to do:

 

ssh: connect to host host.com port 22: Operation timed out

 

I read that my firewall could be blocking port 22, but not sure how to check that out.. I'm on Mac OS X and have my firewall set to "Allow all incoming connections". Could it possibly be something with router settings?

 

Could anybody recommend anything so I can get connected? I know very little about using the terminal and I'm attempting to get a cronjob set up following these steps: http://www.aota.net/Script_Installation_Tips/cronhelp.php4

 

I'm getting stuck on Step 4 with this problem..

 

Thanks!

 

 

If port 22 isn't open then either:

 

1. sshd isn't running on your server; or

2. something (such as a firewall) is blocking the traffic

 

It isn't really clear from your post, but are you trying to ssh from your OS X box (to another system) or are you trying to ssh to OS X?  If it's the latter then check your options in OS X to be sure that the sshd service is running by going into Finder -> Applications -> System Preferences -> Sharing.  Verify that you have the box checked for "Remote Login".

 

If it's the former (from your OS X box to another machine) then the other machine will need to be running the sshd service, and without more information about that box -- it isn't clear how to start said service:

 

- If it's a Windows machine then you would need to install something like Cygwin and start sshd as a service.

- If it's a Linux box then installing and starting sshd depends on your distro (for example, on Ubuntu/Debian you can do: sudo apt-get install openssh-server.  On Fedora it's: yum install openssh-server).

- If it's another OS X box then follow instructions above.

 

 

It could be a router setting too.  If you are trying to ssh from somewhere outside of your firewall (for example, from a coffee shop back to your house) then yes, you need to check the firewall settings.  You probably need to login to the router's config page and look for something like "allow applications" or "port forwarding" -- be sure to forward TCP/IP traffic for port 22 to the desired IP address.

 

If you are just trying to ssh to/from two machines that are both attached to the same router, then it should work without needing to modify router settings.  I would always recommend getting things working on your own network first.  Then you can try from elsewhere and worry about router settings -- knowing that sshd is indeed available.

 

Hope this helps.  If you still can't get it working then post some further info and we'll get it figured out.

Thanks so much for the reply gamblor01!! And what a great reply it is.. It covers all that could possibly be wrong! I gotta save this page to refer to for future use in case I run across any other problems..

 

I am just learning this stuff and did not know that it needed to be enabled on the server.. I had that enabled and it all works great now!!

 

Thanks again!

No problem -- glad I could help.

 

Just to offer a little more insight, yes, you need ssh (more specifically an ssh server, usually started by /etc/init.d/sshd or /usr/sbin/sshd) to be running on the server.  The idea is that the ssh server binds to port 22 and waits/listens for requests to come in from ssh clients.  If you never start sshd on the box you are connecting to, then nobody is listening on port 22 and therefore there is nothing to connect to.

 

Think of it like a phone line (the good ol' land line).  For example, you want to call a friend.  If that friend's phone isn't plugged into the wall jack, then his house cannot accept phone calls.  Therefore, you can call his number as many times as you want but you're not going to get an answer.  As soon as he plugs in his phone, now there is a device waiting for incoming calls.

 

It's a similar idea with ssh.  If you didn't enable the server on the box you wish to connect to, then ssh is "unplugged" and there is nobody listening for incoming connections.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.