UK WEB HOSTING FORUM FOR DISCUSSION ON WEB HOSTING SERVICE AND SUPPORT
LINUX HOSTING WINDOWS HOSTING PACKAGES SHOPPING CART OSCOMMERCE ZEN CART AGORA
ECOMMERCE HOSTING ASP MSSQL FRONTPAGE HOSTING PHP MYSQL HOSTING DISCUSSION FORUM
CPANEL RESELLER HOSTING DEDICATED SERVER VPS HOSTING PLESK VIRTUOZZO
Quick Search
Your forum announcement here!

  eUKhost's Official Web Hosting Forum > Technical Support > System Security

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 19-04-2008, 19:41
Senior Member
 
Join Date: May 2007
Location: Newport, Wales
Posts: 992
Send a message via AIM to WelshTom Send a message via MSN to WelshTom Send a message via Yahoo to WelshTom
Default Securing SSH

Securing SSH is vitally important. Here are a few simple steps which will help you secure SSH on your server.

The first thing you should do is change the port that SSH listens on. This will help prevent automated-hacking tools from trying to brute force their way into your server.

To do this, open your SSH client (Putty is recommended).

Login to your server.

At the command line, you need to go to /etc/ssh

To do this, type "cd /etc/ssh" and hit enter.

You then need to edit the SSH config file. To do this, type "vi sshd_config" at the command prompt.

You will then be presented with the SSH config, please be careful when editing this file - as if you break it, SSH can fail and you will not be able to access your server.

You need to look for the line which should look like the following:

Quote:
Port 22
To change the SSH port, simply hit the insert key on your keyboard, and change 22 to a port of your choice. Please make sure that you open the port in any firewall modules which you have installed, and that the port isn't already in use by some other application.

When you have changed the port number, simple hit escape on your keyboard, and then type ":wq" and hit enter. This will save the file and return you to the console.

When this is done, you'll need to restart SSH as follows:

"service sshd restart"

When I get a bit more time, I'll explain on how to disable Password Authentication, to make your server more secure.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 20-04-2008, 05:24
Rock's Avatar
Technical Support (eUKhost.com)
 
Join Date: Oct 2006
Location: localhost
Posts: 3,356
Send a message via MSN to Rock Send a message via Skype™ to Rock
Cool

Hey Tom

Here's a small one from me.. supporting/securing your views further...

Securing SSH (Secure Shell)
:

It's a protocol which supports logging into a remote system or executing commands on a remote system, using an encrypted communication between the two systems. Hence securing it; itself is a method of securing the server

By default SSH runs on version 1 and allows direct root access to the system. In order to secure the server steps should be taken to disable direct root access within the sshd_config file and any user should be forced to use only protocol 2. Protocol 2 is more secure than 1.

Here's a simple procedure on getting this done quickly:
Quote:
1) vi /etc/ssh/sshd_config
2) Change Protocol 2,1 to Protocol 2
4) PermitRootLogin yes = no
5) Restart SSHD: /etc/rc.d/init.d/sshd restart
Note: Please make a backup of any files you modify, incase you change anything unexpectedly, restoring the system to the original state becomes easier
__________________

Rock _a.k.a._ Jack
Windows Hosting || Windows Reseller Hosting
Cloud Hosting 100% UPTIME! || Powerful Dedicated Servers
Follow eUKhost on Twitter || Join eUKhost Community on Facebook

For complaints, grievances or suggestions kindly email our FeedBack Dept.
Proper action will be taken accordingly & instantaneously!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 22-04-2008, 02:41
Rock's Avatar
Technical Support (eUKhost.com)
 
Join Date: Oct 2006
Location: localhost
Posts: 3,356
Send a message via MSN to Rock Send a message via Skype™ to Rock
Arrow

Further more, SSH can be resource hogger/intensive for your server too if not setup properly, in other words, it can use up all of your resources making the server unusable or rather taking the complete system down .. -

You can limit/prevent such applications and scripts to stay within the limits by setting up the "Shell Resource Limits" for the users.
You can configure shell resource limits in /etc/security/limits.conf on most Linux systems..

Note: Please make a backup of any files you modify, in case you change anything unexpectedly, restoring the system to the original state becomes easier...
__________________

Rock _a.k.a._ Jack
Windows Hosting || Windows Reseller Hosting
Cloud Hosting 100% UPTIME! || Powerful Dedicated Servers
Follow eUKhost on Twitter || Join eUKhost Community on Facebook

For complaints, grievances or suggestions kindly email our FeedBack Dept.
Proper action will be taken accordingly & instantaneously!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 12-06-2008, 22:35
Member
 
Join Date: Jun 2008
Posts: 34
Default

Ouch, telling people to use vi is a dangerous move pico is more user firendly
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 12-06-2008, 22:58
Senior Member
 
Join Date: May 2007
Location: Newport, Wales
Posts: 992
Send a message via AIM to WelshTom Send a message via MSN to WelshTom Send a message via Yahoo to WelshTom
Default

Quote:
Originally Posted by Scothorse View Post
Ouch, telling people to use vi is a dangerous move pico is more user firendly
lol - SSH is a CLI - it's not designed to be user-friendly - nor the stuff which runs on it
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 13-06-2008, 03:48
Rock's Avatar
Technical Support (eUKhost.com)
 
Join Date: Oct 2006
Location: localhost
Posts: 3,356
Send a message via MSN to Rock Send a message via Skype™ to Rock
Wink

Quote:
Originally Posted by WelshTom View Post
lol - SSH is a CLI - it's not designed to be user-friendly - nor the stuff which runs on it
Rightly said ! SSH isn't user friendly, but it's rather more powerful than the GUI mode..
My vote goes for SSH mode for sure.. It's been years I haven't touched GUI..
__________________

Rock _a.k.a._ Jack
Windows Hosting || Windows Reseller Hosting
Cloud Hosting 100% UPTIME! || Powerful Dedicated Servers
Follow eUKhost on Twitter || Join eUKhost Community on Facebook

For complaints, grievances or suggestions kindly email our FeedBack Dept.
Proper action will be taken accordingly & instantaneously!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 13-06-2008, 14:56
eUKhost.com's Avatar
Chief Marketing Officer
 
Join Date: Sep 2005
Posts: 5,925
Send a message via AIM to eUKhost.com Send a message via MSN to eUKhost.com Send a message via Skype™ to eUKhost.com
Default

Quote:
Originally Posted by Scothorse View Post
Ouch, telling people to use vi is a dangerous move pico is more user firendly
yes

Pico is more user friendly and less memory intensive. I'm the only person in our company who uses pico as all other staff members prefer only vi.
__________________
UK Web Hosting || Business Hosting || eUKhost Knowledgebase
Toll Free : 0808 262 0255 || Skype : mark_ducadi
A bunch of Sheep led by a Lion is better than a bunch of Lions led by a Sheep.
__________________________________________________

Please email cmo[at]eukhost.com if you have any questions or need my assistance
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 08-10-2008, 21:24
Junior Member
 
Join Date: Sep 2008
Posts: 17
Default

...The vi/pico debate lives on...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 08-10-2008, 22:48
Rock's Avatar
Technical Support (eUKhost.com)
 
Join Date: Oct 2006
Location: localhost
Posts: 3,356
Send a message via MSN to Rock Send a message via Skype™ to Rock
Smile

Quote:
Originally Posted by kpatey View Post
...The vi/pico debate lives on...
Very true.. which one do you prefer/use ?
__________________

Rock _a.k.a._ Jack
Windows Hosting || Windows Reseller Hosting
Cloud Hosting 100% UPTIME! || Powerful Dedicated Servers
Follow eUKhost on Twitter || Join eUKhost Community on Facebook

For complaints, grievances or suggestions kindly email our FeedBack Dept.
Proper action will be taken accordingly & instantaneously!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 08-10-2008, 23:03
Junior Member
 
Join Date: Sep 2008
Posts: 17
Default

Pico for me ... I think if vi is one of the first editors you use, then you can learn to love it, otherwise pico will always be easier/faster
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 19-08-2009, 14:26
new member
 
Join Date: Aug 2009
Posts: 3
Default

There are more to do in order to secure your ssh. Changing the default ssh port, disable root login are few of them. You can prevent ssh scanners by adding appropriate firewall rules.

HTML Code:
iptables -A FORWARD -p tcp –dport 22 -m state –state NEW -m recent –update –seconds 60 –hitcount 5 –rttl –name SSH -j DROP
The above configuration will allow up to 5 SSH connections in a 60 second timeframe.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 19-08-2009, 16:34
Member
 
Join Date: Jul 2009
Location: Bedfordshire, UK
Posts: 43
Default

Also when choosing alternative port, be sure to choose one that is not associated with viruses. I recently used port 9898 and had problems accessing my server through that particular port. It turned out that it is favoured by a trojan/virus known as MonkeyCom and my ISP was blocking it (could not understand what was happening as had access to all the other services on my VPS, thought I was hacked - tcptracert command in Linux turned out to be invaluable to trace route on a specific port).

If you manage to lock yourself out of the system while configuring your SSHD and you have access to WHM you can run the following to temporarily reset your SSH settings back to default:

Code:
whm.yourdomain.tld/scripts2/doautofixer?autofix=safesshrestart
Now you should be able to log in with your credentials on port 22, fix the configuration issues, reboot SSHD.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 29-01-2010, 15:05
new member
 
Join Date: Jan 2010
Posts: 6
Default

Hi.

I am a bit of a neewbie with this stuff. How would I change my port using WinSCP. How do I get to a command line in WinSCP. Also on WinSCP website it has this paragraph,

"However, please ensure that the server you are connecting to is a secure server to start with - WinSCP only secures a particular file transfer session from server to client and from client to server. If you still have open FTP or Telnet port on your server, you are not safe!"

Is this something I should be aware off, and who would I ask to get it sorted.

Thanks form a neebie worried about security
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 30-01-2010, 12:18
Rock's Avatar
Technical Support (eUKhost.com)
 
Join Date: Oct 2006
Location: localhost
Posts: 3,356
Send a message via MSN to Rock Send a message via Skype™ to Rock
Smile

Quote:
Originally Posted by craigbeattie View Post
Hi.

I am a bit of a neewbie with this stuff. How would I change my port using WinSCP. How do I get to a command line in WinSCP. Also on WinSCP website it has this paragraph,

"However, please ensure that the server you are connecting to is a secure server to start with - WinSCP only secures a particular file transfer session from server to client and from client to server. If you still have open FTP or Telnet port on your server, you are not safe!"

Is this something I should be aware off, and who would I ask to get it sorted.

Thanks form a neebie worried about security
Hi,

It's recommended to connect to a Linux server using SSH for doing such changes.

Here's a tutorial on : How to connect to a Linux Server using SSH ?

& follow the steps mentioned in the first post here.
__________________

Rock _a.k.a._ Jack
Windows Hosting || Windows Reseller Hosting
Cloud Hosting 100% UPTIME! || Powerful Dedicated Servers
Follow eUKhost on Twitter || Join eUKhost Community on Facebook

For complaints, grievances or suggestions kindly email our FeedBack Dept.
Proper action will be taken accordingly & instantaneously!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT. The time now is 21:19.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
UK Web Hosting by eUKHosting 3.1.0
UK Web Hosting by eUKHosting 3.1.0
Copyright © 2001-2012, eUKhost LTD. All rights reserved.

 


UK VPS Hosting
VPS Hosting plans

Dedicated Server Hosting
Dedicated Server plans

VoIP Dedicated Servers
Asterisk, Trixbox Dedicated Servers

Business Web Hosting
100% uptime Hosting

UK Cpanel Hosting
cPanel Shared Hosting

Domain Hosting
Cheap Domains & Hosting Plans

UK Reseller Hosting
Reseller Web Hosting

Windows Hosting
Windows Shared Hosting

Windows VPS

Windows VPS Hosting

Semi Dedicated Servers
Semi-Dedicated Hosting

Dedicated Server Mirroring
Dedicated Server Mirroring

Webhosting Knowledgebase
Frequently asked Questions

Web Hosting Blog
eUKhost Blog

Web Hosting Support
Support Helpdesk

UK Data Center
eUKhost Datacenter

Web Hosting Forum
eUKhost Forum

Support Tutorials
Online Flash Tutorials

Offsite Back-up Plans
Remote Backup Service

ColdFusion Hosting
ColdFusion Web Hosting
 
 

Android and Apple App


knowledgebase articles
eUKhost.com Services

Pre-Sales Questions
Pre-sales FAQ's

Domain Names
Domain registration FAQ's

cPanel Hosting
cPanel Hosting FAQ's

Windows Web Hosting
Plesk Control Panel

Reseller Hosting
Reseller Hosting FAQ's

VPS Hosting
Virtual Private Server

Semi-Dedicated Servers
Semi-Dedicated FAQ's

Dedicated Servers
Dedicated Server Hosting

Joomla Hosting
Joomla Web Hosting

Mambo Hosting
Mambo Web Hosting

Magento Hosting
Magento Web Hosting

Wordpress Hosting
Wordpress Web Hosting

 

Web Hosting Affiliate Program
 

popular blog categories

UK Web Hosting
UK Hosting articles

Dedicated Server Hosting
Dedicated Server guidelines

VPS Hosting
VPS hosting articles

cPanel Hosting
cPanel Hosting articles

Linux Operating System
Linux Operating techniques

Windows Web Hosting
Windows plesk articles