Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I get this error when ever I try to connect my desktop with another desktop using SSH, but I'm able to ping the other desktop successfully.

ssh: connect to host 192.168.1.7 port 22: Connection refused

When I try to restart sshd, it says sshd : unrecognized service I can connect to remote server using SSH but I'm not able to connect within the local network.
Please help me in this regards,

Thanks in advance.

share|improve this question
    
Please provide the command line you are using, or the application. Also add the Ubuntu version. Are these two desktops on the same LAN (local network)? –  david6 Feb 13 '13 at 7:42
1  
How are you trying to start the ssh daemon? You should be using sudo service ssh start. If that doesn't work, could you post the output of ls -l /etc/init/ssh.conf ? –  Jeremy Kerr Feb 13 '13 at 7:43
    
@david6, if they weren't on the same LAN, then the connection would just fail or be blackhole'd. He's getting a refused connection which means that a computer saw the request and sent back a refusal. –  Nathan J. Brauer Feb 13 '13 at 9:18
    
Im using Ubuntu 12.10, where I need to ssh to another computer within the same local network. But, I'm able to connect to a remote server in another network. Please help me... –  Rudra Feb 13 '13 at 9:19
    
Confirm if you are using a firewall. Is SSH server installed on each target host? –  david6 Feb 13 '13 at 10:39
show 1 more comment

3 Answers 3

Try un-installing and then installing openssh-server:

sudo apt-get remove openssh-client openssh-server

and then

sudo apt-get install openssh-client openssh-server

This worked for me. If you still can not connect, try

sudo ufw status verbose

and let us know what the output is.

share|improve this answer
add comment

First make sure that ssh service running on 192.168.1.7 or not..it is possible that system doesn't have an SSH daemon, so you need to install ssh on that system.

sudo apt-get install openssh-server

If it's already installed, run sudo service ssh restart, then comment here with the output of this command from both the systems.

share|improve this answer
    
When I restart the ssh it stops first and starts with a PID no. –  Rudra Feb 13 '13 at 9:20
add comment

In my installation of Ubuntu 14.04 LTS desktop edition from the Ubuntu website, openssh-server is not installed by default. BIG FAT THUMBS DOWN Canonical!!!!! The installation is relatively easy and has been mentioned already by other answers above:

sudo apt-get update && sudo apt-get upgrade && sudo apt-get install openssh-server

share|improve this answer
    
omg, have you called the police? –  chaos Jun 3 at 21:15
    
no, but I figure NSA already read this post, and I'm considering Twittering the FBI! –  MishaP Jun 3 at 22:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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