LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-17-2012, 09:57 AM   #1
scottpops
LQ Newbie
 
Registered: May 2012
Posts: 5

Rep: Reputation: Disabled
Help with Ubuntu server remote ssh and local network ssh issues using putty.


Hello,

I have recently installed Ubuntu Server 12.04 on my home server. There are 2 issues that I am trying to solve.

First of all, I am having trouble connecting using Putty on my Windows 7 machine on the local network. I can, however, connect locally using my laptop which has Debian 6.0.4 and it works great so I am sure that I have the ssh server up and running on the server machine. The only 3 lines that I changed in the sshd_config file were "Port xxxx", "PermitRootLogin no", and "X11Forwarding no", everything else is default.

In Putty I enter the local static IP (which I set) of the server and the port which I am now using after changing the sshd_config file. I also set the correct auto-login username for the server. When I try to connect, it gives me: "Putty Fatal Error: Network Error: Connection Refused"

Also I am having trouble connecting remotely from my laptop with Debian 6.0.4 on it. I did enable port forwarding on the correct port in my router. In Debian I try to use the command:

ssh username@xxx.xxx.xxx.xxx -p xxxx

using the public IP address of my home network and the port that I have opened up on that network. I receive the same "Connection Refused".

I am wondering if there are certain settings in the sshd_config file that I need to change? Maybe restarting the router? I am not at home and cannot connect to the server machine right now, as I said, but I was hoping for some suggestions or maybe someone has had the same issues and knows exactly how to fix it. Thank you.

Scott.
 
Old 05-17-2012, 10:13 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
soudns like the iptables firewall rules on ubuntu are configured to not allow the right port in. SSHD itself will not require any changes whatever, but as you've changed the port number (did you have a good reason??) then that needs to be opened up on the rules.
 
Old 05-17-2012, 10:15 AM   #3
scottpops
LQ Newbie
 
Registered: May 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Just for security purposes. As I have been researching, it seemed like a general consensus that it was a good idea to change from the default port 22.
 
Old 05-17-2012, 10:16 AM   #4
scottpops
LQ Newbie
 
Registered: May 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
So how would I go about changing the Ubuntu firewall settings?
 
Old 05-17-2012, 10:26 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
obscurity is not really security. If this is just on a LAN, change it back.

I've not used Ubuntu for a while, so someone may well correct me, but first off check that ufw is running - "sudo ufw status". try disabling it - "sudo ufw disable" and try connecting again. Presuming that does work, reenable and add port access ass per the rest of the docs - https://help.ubuntu.com/community/UFW

Last edited by acid_kewpie; 05-17-2012 at 10:32 AM.
 
Old 05-17-2012, 10:40 AM   #6
scottpops
LQ Newbie
 
Registered: May 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
OK, thank you for your replies. The Putty issue is just on the LAN, but I am trying to set it up so I can remote in as well from other locations. That is where I thought I would need to be a little more obscure in my port selection. I am first going to try and change the port back and see if that fixes it, because that will be a good indication if that is the issue. Then I can dig into the Ubuntu firewall stuff if I feel the need to after that.
 
Old 05-17-2012, 10:43 AM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Looking around, there are people saying that ufw isn't even running by default, so do check.

Ultimately, you can print the REAL REAL iptables rulebase running underneath ufe with "iptables -vnL" that'll give you , and us, a very clear view of what's going on at a distro agnostic level.
 
Old 05-17-2012, 04:45 PM   #8
scottpops
LQ Newbie
 
Registered: May 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
UFW is inactive by default. I changed the port back to 22 and at least the Putty issue is definitely resolved. I will check later tonight to see if I can remote in from another network. Thank you for your help. So there is no real advantage to changing the port that I use for my remote connections?
 
Old 05-17-2012, 05:07 PM   #9
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Yes, it stops all the bots from hammering on your port 22 and filling your logs.

Simply forward a random high external port to port 22 on your local machine, and use that high port from outside.
 
  


Reply



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
SCP issues over SSH... can't seem to copy from remote to local. ncn8ochaser Linux - Newbie 3 11-18-2010 12:17 AM
[SOLVED] Putty - ssh to ubuntu server 9.10 avtandil_k Linux - Newbie 4 04-05-2010 02:28 PM
Ubuntu 6.06 Server(SSH Setup/Putty) TechMansoor Linux - Networking 1 12-16-2006 09:05 PM
how to install software on remote pc using putty/ssh glorsplitz Linux - Networking 5 07-07-2006 08:01 AM
Backing up remote Linux Server to Local Win2KPro CD-RW over SSH McK66 Linux - General 3 06-08-2004 09:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:31 AM.

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
Open Source Consulting | Domain Registration