LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-16-2012, 02:44 PM   #1
thallium
Member
 
Registered: Oct 2012
Location: Austin, TX
Distribution: Ubuntu Server 12.04
Posts: 33

Rep: Reputation: Disabled
Unhappy SSH no working, Ubuntu Server 12.04


I feel like I have come so far but have a lot more to go, so here is my problem:

I installed ubuntu 12.04 on a Dell Precision 670 I got for cheap. Everything seemed to be going well. I made a static IP for the server, made a static IP for the router and my friends and I can view the default web page of the server from the internet. I even got a desktop environment installed, but hated it and now boot directly into the terminal sans GUI.

After these minor accomplishments, I want to now manage my box remotely via SSH. I installed OpenSSH and SSH and started a session, at root. Then I went to my WinXP laptop and attempted to connect to the server locally with Putty, Connection Refused error. I have kept everything as port 22, just to keep things simple for for now.

I check to see if my server is listening for port 22:

# sudo netstat -pane | grep 22

but there are no IP addresses listening for that port!

I then (as root) start the ssh service again:

# sudo service ssh start
-> ssh start/pre-start, process 2524

I check to see if there is an ip address listening to 22, but nothing. I have forwarded port 22 on my router to my servers local IP.

I feel like I am almost there to actually getting somewhere with linux, but I keep running into a roadblock like this at every turn, and all the tutorials make this seem so easy!!
 
Old 10-16-2012, 03:00 PM   #2
valdinei
LQ Newbie
 
Registered: Jul 2012
Location: Brazil
Distribution: Ubuntu, Freebsd, CentOS
Posts: 17

Rep: Reputation: Disabled
I tested in my ubuntu

Code:
# aptitude install ssh

# ssh localhost -p 22
What result you have with this test?
 
Old 10-16-2012, 03:09 PM   #3
thallium
Member
 
Registered: Oct 2012
Location: Austin, TX
Distribution: Ubuntu Server 12.04
Posts: 33

Original Poster
Rep: Reputation: Disabled
# aptitude install ssh
-> The following packages will be REMOVEDL
linux-headers-2.2.0-29{u}.......etc

I chose no for now.

# ssh localhost -p 22
->ssh: connect to host localhost port 22: Connection refused

yeah, I can't even connect to my own server or something!
 
Old 10-16-2012, 03:11 PM   #4
valdinei
LQ Newbie
 
Registered: Jul 2012
Location: Brazil
Distribution: Ubuntu, Freebsd, CentOS
Posts: 17

Rep: Reputation: Disabled
You donīt have ssh server running

Or Firewall is available and "ON"

Last edited by valdinei; 10-16-2012 at 03:12 PM.
 
Old 10-16-2012, 03:14 PM   #5
thallium
Member
 
Registered: Oct 2012
Location: Austin, TX
Distribution: Ubuntu Server 12.04
Posts: 33

Original Poster
Rep: Reputation: Disabled
I thought I had started it, but maybe it keeps stopping? I thought this started it:

# sudo service ssh start

but even after running the command again, I still get connection refused! This seems like it is supposed to be one of the easiest things to get going on ubuntu, but it just won't happen, I am logged in as root also, just to make sure.
 
Old 10-16-2012, 03:19 PM   #6
jsaravana87
Member
 
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 558
Blog Entries: 5

Rep: Reputation: Disabled
#service ssh status -check whether service running fine


Im not sure i guess your ssh is listening on any other port other than port 22.If your ssh running fine.


#grep port /etc/ssh/sshd_config -Check ssh listening port

#netstat -apn -Check whether ssh is listening

#iptables -L --check whether ssh port is opened

Last edited by jsaravana87; 10-16-2012 at 03:21 PM.
 
Old 10-16-2012, 03:34 PM   #7
valdinei
LQ Newbie
 
Registered: Jul 2012
Location: Brazil
Distribution: Ubuntu, Freebsd, CentOS
Posts: 17

Rep: Reputation: Disabled
You are right arun5002. The service may be listening to another ssh port. I use -p 22 for test this
 
Old 10-16-2012, 04:29 PM   #8
thallium
Member
 
Registered: Oct 2012
Location: Austin, TX
Distribution: Ubuntu Server 12.04
Posts: 33

Original Poster
Rep: Reputation: Disabled
I can't check up non everything right now, I will have to wait until I get home tonight. I know I have checked sshd_config file and made sure that all the ports were 22.

However, it does not seem to be listening to port 22 when I run the latter commands. It is really weird, I'm starting the service with all ports 22, but it definitely seems like ssh is just not running.

I really haven't done anything to SSH after installing and thought that by just installing it and running putty on my winXP box right after, I'd at least get a test session going before adding more security. But unfortunately, nothing in linux seems that simple.
 
Old 10-16-2012, 11:15 PM   #9
thallium
Member
 
Registered: Oct 2012
Location: Austin, TX
Distribution: Ubuntu Server 12.04
Posts: 33

Original Poster
Rep: Reputation: Disabled
Check Up

Ok,

I run: # service ssh status

I get: ssh stop/waiting

It seems like ssh is not running, but haven't I already started the process by running:
# service ssh start

then I get: ssh start/running, process 4101

when I got back to check the status, it stays that it is "stop/waiting" it is very weird. I definitely have ssh installed, I can start it up with a process id, but then it seems to stop. I check the ports in sshd_config, all are 22.
 
Old 10-17-2012, 03:18 AM   #10
thallium
Member
 
Registered: Oct 2012
Location: Austin, TX
Distribution: Ubuntu Server 12.04
Posts: 33

Original Poster
Rep: Reputation: Disabled
Another observation

I went back and reinstalled OpenSSH Server
Things seemed to go well, just said I needed to reboot so some file could be configured correctly. I restart my machine and during the boot sequence, lots of lines about OpenSSH show up, but one of them is marked by a red [FAIL]. I don't know what is different about that line it is literally all the same up until the fail part.

Thanks a lot!

#service ssh status

still shows

->ssh stop/waiting

after attempting to start
 
Old 10-17-2012, 04:01 AM   #11
thallium
Member
 
Registered: Oct 2012
Location: Austin, TX
Distribution: Ubuntu Server 12.04
Posts: 33

Original Poster
Rep: Reputation: Disabled
Firewall

I check ufw and found that port 22 if open, active and will accept Anywhere. So I don't think the firewall is messing things up.
 
Old 10-19-2012, 05:19 AM   #12
thallium
Member
 
Registered: Oct 2012
Location: Austin, TX
Distribution: Ubuntu Server 12.04
Posts: 33

Original Poster
Rep: Reputation: Disabled
Solved

I found out the sshd_config file had multiple duplicated sections, very weird. I must have done this on accident while using nano. I reinstalled the original port 22 file and everything worked perfectly. Thanks for the tips everyone!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Ubuntu server remote ssh and local network ssh issues using putty. scottpops Linux - Server 8 05-17-2012 06:07 PM
Firestarter kills OUTGOING SSH Ubuntu 10.04- rejects SYN/ACK from SSH server edsmithers Linux - Networking 3 09-29-2010 03:53 PM
Slow ssh connection over lan with Ubuntu Desktop and Ubuntu Server Recursion Linux - Networking 1 05-23-2009 03:17 AM
SSH not working from other ubuntu server, but from windows? SimbaSpirit Linux - Software 11 07-03-2008 07:06 PM


All times are GMT -5. The time now is 06:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration