LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to prove that I was able to do secure copy (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-prove-that-i-was-able-to-do-secure-copy-4175456903/)

sysmicuser 04-04-2013 07:01 PM

How to prove that I was able to do secure copy
 
Hi Guys,

I have a Unix Server where I was able to do secure copy (scp)but now I am able to. I want to prove it is there any log file I can have a look at which states success and / or says I did scp?

Please help me here.

Thank you

chrism01 04-04-2013 08:05 PM

If it fails, it'll tell you. You can also check the exit code '$?'; should be 0 (zero) for success.
If this is in a script, make sure you check the exit code and log both stdout and stderr eg
Code:

# call script
./myscript.sh >myscript.log 2>&1

# basic code for script
#!/bin/bash
scp myfile user@host:/dir/myfile
if [[ $? -ne 0 ]]
then
    echo "scp failed with $?"
fi

The error msgs will appear in the logfile.

sysmicuser 04-04-2013 10:48 PM

I am not talking about scripting point of view but auditing point of view

I did ran scp sometime back is there anywhere store is system log about command a user performs I believe there must be.

dmesg?

ilesterg 04-04-2013 11:15 PM

In your first question, you wanted to know if the command ran to success or not. In your next, you wanted to know if there is a history of commands a user perform. Which is it?

H5X00R 04-05-2013 04:19 PM

As root, you can view the history of the user(s)

Or a better way, you could do process accounting. It will give you a audit of your system and track commands executed by users. This article will explain it better http://www.cyberciti.biz/tips/howto-...ccounting.html

jpollard 04-05-2013 05:19 PM

The normal service logs (normally /var/log/messages) would have information about the login.


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