LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 09-10-2008, 03:14 PM   #1
kaplan71
Member
 
Registered: Nov 2003
Posts: 809

Rep: Reputation: 39
SSH Server Connection Question


Hi there --

We have an SSH server that is periodically used for remote connections to our network. The following incident occurred earlier today, and I wanted to get feedback.

A visiting scholar is on-site and has a connection to the server. A routine check of the server indicated the user account had connected to the server from a remote location.

I am concerned this could be a case of either a compromised or shared user account and password. Am I being overly paranoid about this? What steps should I take to get to the bottom of the mystery? Thanks.
 
Old 09-10-2008, 03:19 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
There are various options depending on the specifics:
  • Can sshd access be limited to only certain subnets (thereby denying all others)? That's an effective way to lock things down.
  • Is "visiting scholar" finished with his work? Make use of the AllowUsers and/or DenyUsers directives (see the manpages for sshd_config(5)), and lock out his account.
  • Will "visiting scholar need to make ongoing visits and access the account on-site again in the future? Again, the AllowUsers directive can contain an entry that only allows him to log in via ssh from certain subnets using the form user@host.

No, you're not being overly paranoid about this. Take shell access to your servers very seriously.
 
Old 09-10-2008, 03:20 PM   #3
CRC123
Member
 
Registered: Aug 2008
Distribution: opensuse, RHEL
Posts: 374
Blog Entries: 1

Rep: Reputation: 32
there is a '.bash_history' file in every users home directory. If they didn't know to delete it's contents, you can see the commands that they have been running. I hope you catch them RED HANDED, lol
 
Old 09-10-2008, 03:22 PM   #4
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
You're not overly paranoid.

Take some steps to verify the source of the "external" connection, though. It's possible the visitor logged in from "outside" by using a VPN to get back to their "home" network (thus all their traffic was showing up as coming from wherever they usually reside, even if they were connected to your network), or by using a mobile wireless card (the kind that use cellular networks).
 
Old 09-10-2008, 03:23 PM   #5
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Quote:
Originally Posted by CRC123 View Post
there is a '.bash_history' file in every users home directory. If they didn't know to delete it's contents, you can see the commands that they have been running. I hope you catch them RED HANDED, lol
Not necessarily. If they aren't using the bash shell, it doesn't exist. Not all shells create a history file by default, and of course the history settings can be overridden.
 
Old 09-10-2008, 04:22 PM   #6
kaplan71
Member
 
Registered: Nov 2003
Posts: 809

Original Poster
Rep: Reputation: 39
Hi there --

Thanks for the replies from everyone. Going by the following suggestion:

Quote:
Take some steps to verify the source of the "external" connection, though. It's possible the visitor logged in from "outside" by using a VPN to get back to their "home" network (thus all their traffic was showing up as coming from wherever they usually reside, even if they were connected to your network), or by using a mobile wireless card (the kind that use cellular networks).
I have already checked the secure log files as well as run a whois check on the address. Additionally, I have checked the user's history file for anything suspicious. Beyond that, is there anything else or any utilities that can come into play here? Thanks.
 
Old 09-10-2008, 04:28 PM   #7
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Code:
$ dig -x <ip address connection came from>
Gets the reverse DNS entry, might give more clues to the origin than whois information.

Code:
$ traceroute <ip address connection came from>
Shows the network path back to them, router names usually have abbreviation for the service provider and/or locality, so this gives you a geographical idea where the connection was from. If that seems to match where the visitor comes from, then they were probably just using a VPN. If it matches a mobile carrier, then they were probably using a wireless data card. If it doesn't match at all, then it's possible an unauthorized party access their account.

Have you tried the simple step of just asking the visitor how/when they accessed the system in question, and if they may have given their login information to anyone else?
 
Old 09-10-2008, 05:05 PM   #8
kaplan71
Member
 
Registered: Nov 2003
Posts: 809

Original Poster
Rep: Reputation: 39
Hi there --

Going on somewhat of a tangent here: Is there software that would bring up a world map that could be used in conjunction with dig and traceroute? Thanks.
 
Old 09-11-2008, 07:20 AM   #9
rosv
Member
 
Registered: Jul 2008
Distribution: Slackware, ubuntu
Posts: 53

Rep: Reputation: 15
You could try http://whatismyipaddress.com/staticp...ual-traceroute
 
Old 09-11-2008, 11:32 AM   #10
mlnutt
Member
 
Registered: May 2006
Posts: 34

Rep: Reputation: 15
Perhaps the easiest thing to do would be to ask your user if they have given their logon info to anyone else; if not, explain that the account info may have been "stolen." Explain vaguely that their account had logged on remotely. Explain your policy. Change the password. If it happens again disable the account.
 
  


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
ssh server connection time out solarbike Linux - Newbie 8 07-29-2008 04:10 AM
SSH server allows connection...then hangs Pagoda Gift Shop Linux - Server 4 11-20-2007 05:20 PM
ssh connection refused - trying to set up ssh server at home openSauce Linux - Server 10 10-18-2007 04:38 PM
ssh connection closed by server m_yates Linux - Security 3 08-10-2005 03:12 PM
SSH - X server connection problem satimis Linux - Networking 5 04-29-2004 02:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 06:26 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
Open Source Consulting | Domain Registration