LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ssh requirement (https://www.linuxquestions.org/questions/linux-newbie-8/ssh-requirement-753282/)

thangappan 09-07-2009 06:53 AM

ssh requirement
 
Dear all,


I am using Debian operating system. I am having one requirement in ssh program.

Whenever I put ssh and my machine IP address in any system, I want to log the details of that machine. For an example my machine address is 192.1.1.20. I put ssh from 192.168.2.3.

In the above case, at any time I could the see the details saying that, "in this time you are put ssh to your machine from 192.168.2.3 IP address".



Whether my understanding is wrong?
Or
Is there any way to achieve this?

jschiwal 09-07-2009 07:00 AM

Could you please rephrase your question. What do you mean by "put ssh".

Do you mean make a connection?

If you want a log of incoming connections, you can configure syslog-ng to do it. It probably already prints a line in /var/log/messages or /var/log/secure that looks like this:

Aug 31 20:26:47 qosmio sshd[13992]: Accepted publickey for jschiwal from 192.168.1.105 port 41594 ssh2

Look at the /etc/syslog-ng/syslog-ng.conf file. The mail and news entries may make good models to use to add another destination log for sshd.

thangappan 09-08-2009 02:48 AM

Clarification
 
The question is simple,

Let consider A and B is working in one network(192.168.1.*)
AND
C and D is working in another network(192.168.2.*)

Now A wants to work from the D system(192.168.2.*) with his login.So He put ssh connection to his machine(192.168.1.*)

$ ssh A@192.168.1.1 -tX

Here is my question.

I want to log the details
From which machine A put ssh connection to his system
Who is currently using that machine
On what time I used that command.

In the above case the details could be
machine IP 192.168.2.*
Name D
Time Current time when he used that command.


Is it possible to do?


I think this explanation is enough? Please help me...........

zhjim 09-08-2009 03:46 AM

Quote:

Originally Posted by thangappan (Post 3673953)
The question is simple,

does not seem like that or it would be answered:p

Quote:

Originally Posted by thangappan (Post 3673953)
Is it possible to do?

I think this explanation is enough? Please help me...........

Sure it is jschiwal already answered it (Hm maybe it is an easy question :D) Check out your /var/log/secure file. There should be listed all the logins that ocurred. If not dig on the syslog.conf manpage a bit or skim the net for a howto


All times are GMT -5. The time now is 08:57 PM.