hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : VPS Hosting : VPS Tutorials : is there anyways to do this ?
Reply

VPS Tutorials Tutorials related to VPS.
Forum Jump

is there anyways to do this ?

Reply Post New Thread In VPS Tutorials Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 04-25-2012, 02:12 AM
DevilCrab DevilCrab is offline
Junior Guru Wannabe
 
Join Date: Apr 2011
Posts: 66

is there anyways to do this ?


hey is there anyway to keep getting log of commands run on linux centos VPS too keep watch.. like we have commands to get login IP and details when SSHed. so similarly i wanna keep log of commands anyone run in SSH.

is there anyway ?

Reply With Quote


Sponsored Links
  #2  
Old 04-25-2012, 02:28 AM
SeriesN SeriesN is offline
Oh, I'm a Gummy Bear,
 
Join Date: May 2011
Location: New York, USA
Posts: 3,488
"last" gives couple of last commands that were ran via ssh. I am pretty sure there is a log somewhere depending on your distro.

Reply With Quote
  #3  
Old 04-25-2012, 04:05 AM
DevilCrab DevilCrab is offline
Junior Guru Wannabe
 
Join Date: Apr 2011
Posts: 66
hmm can anyone help me finding that log file ? or any method i receive those log file using email ?

actually i wanna keep track of my VPS usage using SSH, so if anyone try too root or hack it i can track him. Also, how does servers of hostgator and big companies are safe all times from bots , trojans, phishings etc ? ?? ?

What do they do and how do they keep track...

Reply With Quote
Sponsored Links
  #4  
Old 04-25-2012, 09:48 AM
SeriesN SeriesN is offline
Oh, I'm a Gummy Bear,
 
Join Date: May 2011
Location: New York, USA
Posts: 3,488
Quote:
Originally Posted by DevilCrab View Post
hmm can anyone help me finding that log file ? or any method i receive those log file using email ?

actually i wanna keep track of my VPS usage using SSH, so if anyone try too root or hack it i can track him. Also, how does servers of hostgator and big companies are safe all times from bots , trojans, phishings etc ? ?? ?

What do they do and how do they keep track...
For that my friend, you either need skill or money or Both!

Reply With Quote
  #5  
Old 04-26-2012, 11:34 AM
DevilCrab DevilCrab is offline
Junior Guru Wannabe
 
Join Date: Apr 2011
Posts: 66
Quote:
Originally Posted by SeriesN View Post
For that my friend, you either need skill or money or Both!

lol.. are you really kidding ?

i thought i just said i wanna learn how to do that ! and for that i know it may cost to learn .. :\

Reply With Quote
  #6  
Old 05-10-2012, 02:24 PM
Shine Servers Shine Servers is offline
Disabled
 
Join Date: May 2012
Location: New Delhi,India
Posts: 59
Quote:
Originally Posted by DevilCrab View Post
hey is there anyway to keep getting log of commands run on linux centos VPS too keep watch.. like we have commands to get login IP and details when SSHed. so similarly i wanna keep log of commands anyone run in SSH.

is there anyway ?

The Logwatch package will email you a daily summary of a number of server logs, including the SSHd log. I get a summary of who successfully logged in via SSH, how many times, and from where, as well as what IPs tried to log in unsuccessfully and what credentials they used. It gets long if someone tries a brute-force SSH attack on a host where I'm allowing password authentication (I try to avoid that, favoring RSA keys instead, but the customer is always right and doesn't always understand public-key authentication. Anyway.)

To install Logwatch (which is basically just a collection of Perl filters for digesting various log formats) on Ubuntu, use apt-get install logwatch and then edit /etc/cron.daily/00logwatch, replacing --output mail with --mailto you@yourdomain.com. You'll get one a day. You can add more flags to tune which logs Logwatch actually reads.

Reply With Quote
  #7  
Old 05-28-2012, 02:00 AM
whrss whrss is offline
Premium Member
 
Join Date: May 2009
Location: SLASH ROOT
Posts: 554
@DevilCrab, the log file /var/log/secure will give you the details of the user who logged in:

For eg:
Code:
May 28 11:10:30 vps sshd[23627]: Accepted password for root from x.x.x.x port 60213 ssh2
May 28 11:10:30 vps sshd[23627]: pam_unix(sshd:session): session opened for user root by (uid=0)
May 28 11:17:20 vps sshd[23627]: pam_unix(sshd:session): session closed for user root
May 28 11:17:26 vps sshd[29987]: Accepted password for root from x.x.x.x port 58425 ssh2
May 28 11:17:26 vps sshd[29987]: pam_unix(sshd:session): session opened for user root by (uid=0)
May 28 11:23:27 vps su: pam_unix(su:session): session opened for "ssh_user" user by root(uid=0)
May 28 11:25:06 vps su: pam_unix(su:session): session closed for "ssh_user" user
To know the commands the user ran, you can check the .bash_history file in their home directory.

For user root, it will be /root/.bash_history and for other users, it will be:

/their_home_dir/.bash_history

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?