LinuxQuestions.org
Help answer threads with 0 replies.
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 04-28-2010, 07:22 PM   #1
davidlu766
LQ Newbie
 
Registered: Apr 2010
Posts: 23

Rep: Reputation: 15
How to monitor ssh connection


Hi,

I will be hiring Linux freelancers very soon to do some work on my Linux Centos 5 machine. And I need a way to see what he's doing on my computer over ssh, now I don't mean me reading the logs, I meaning seeing what he's doing in realtime (kind of like vnc, but except the freelancer will only use ssh to do his work and not on the desktop environment.)
 
Old 04-28-2010, 07:46 PM   #2
dxqcanada
Member
 
Registered: Sep 2006
Location: Canada
Distribution: Gentoo
Posts: 702

Rep: Reputation: 43
Not easily.

SSH sessions are encrypted.
You would have to crack the encryption key to decipher the data.

All you would be able to see with a network trace is the source and destination host IP address and port (which most likely be TCP 22).

You should be able to see some things by monitoring your logs and process' that they might start.
 
Old 04-28-2010, 07:50 PM   #3
davidlu766
LQ Newbie
 
Registered: Apr 2010
Posts: 23

Original Poster
Rep: Reputation: 15
But I have ROOT access...
 
Old 04-28-2010, 07:57 PM   #4
dxqcanada
Member
 
Registered: Sep 2006
Location: Canada
Distribution: Gentoo
Posts: 702

Rep: Reputation: 43
That does not matter.

SSH was specifically designed to be secure ... so unless your computer has the computing power to decrypt the key, all you have is just monitoring what process' the User is running and anything that is logged.
 
Old 04-28-2010, 08:02 PM   #5
davidlu766
LQ Newbie
 
Registered: Apr 2010
Posts: 23

Original Poster
Rep: Reputation: 15
Yes, but don't I already have the ssh key somewhere on the system since it's my system?
 
Old 04-28-2010, 08:02 PM   #6
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,780

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
A GNU screen multiuser session would be the commandline equivalent of VNC.
 
Old 04-28-2010, 08:08 PM   #7
dxqcanada
Member
 
Registered: Sep 2006
Location: Canada
Distribution: Gentoo
Posts: 702

Rep: Reputation: 43
The encryption key is created during the SSH session negotiation.
You will not have access to this key.

You can use some utilities that can track what a User is doing on the system ... here is one that I googled:
whowatch
 
Old 04-28-2010, 08:48 PM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,358

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Try http://sourceforge.net/projects/rootsh/

EG
http://forums11.itrc.hp.com/service/...readId=1002519
Quote:
Okay all I found a solution for my probblem that's working!

I simply changed the default shell for the admin user to my rootsh, and added rootsh in the /etc/shells. And then I have logging from the first second a admin user loggs in to the server until he loggs out!
 
Old 04-29-2010, 03:01 AM   #9
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by dxqcanada View Post
You would have to crack the encryption key to decipher the data.
Completely the wrong approach...


Quote:
Originally Posted by chrism01 View Post
...and that's the right tool for the job.
 
Old 04-29-2010, 03:04 PM   #10
davidlu766
LQ Newbie
 
Registered: Apr 2010
Posts: 23

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by chrism01 View Post
Is the log updated in realtime? Because I was thinking about doing "tail -f" to see what they're doing in realtime...

thanks.

Last edited by unSpawn; 04-29-2010 at 06:23 PM. Reason: //closed quoting
 
Old 04-29-2010, 03:10 PM   #11
unixfool
Member
 
Registered: May 2005
Location: Northern VA
Distribution: Slackware, Ubuntu, FreeBSD, OpenBSD, OS X
Posts: 782
Blog Entries: 8

Rep: Reputation: 158Reputation: 158
Quote:
Originally Posted by davidlu766 View Post
Quote:
Originally Posted by chrism01 View Post
Try http://sourceforge.net/projects/rootsh/

Is the log updated in realtime? Because I was thinking about doing "tail -f" to see what they're doing in realtime...

thanks.
'tail -f' on what? Visit the site for rootsh and see how the tool is supposed to work...better yet, just give it a shot. If it doesn't work for you, you can still use tail. It never hurts to at least try out a recommended tool or at least study up on it.

Last edited by unSpawn; 04-29-2010 at 06:24 PM. Reason: //closed outer quote
 
  


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: connection to host port: 22: Connection timed out lost connection cucolin@ Linux - Server 4 11-22-2011 06:15 AM
[SOLVED] How do I ssh onto slackware 10 with no monitor NightSky Slackware 8 08-22-2009 04:04 PM
LXer: ssh-xfer: Quickly grabbing files over an existing SSH connection LXer Syndicated Linux News 0 08-08-2008 03:11 PM
ssh connection refused - trying to set up ssh server at home openSauce Linux - Server 10 10-18-2007 04:38 PM
No monitor in X and no SSH haggertus Linux - Newbie 2 10-25-2003 06:33 PM

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

All times are GMT -5. The time now is 06:40 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