Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-04-2013, 07:01 PM   #1
Registered: Mar 2010
Posts: 353

Rep: Reputation: 0
Unhappy 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
Old 04-04-2013, 08:05 PM   #2
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,347

Rep: Reputation: 2365Reputation: 2365Reputation: 2365Reputation: 2365Reputation: 2365Reputation: 2365Reputation: 2365Reputation: 2365Reputation: 2365Reputation: 2365Reputation: 2365
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
# call script
./ >myscript.log 2>&1

# basic code for script
scp myfile user@host:/dir/myfile
if [[ $? -ne 0 ]]
    echo "scp failed with $?"
The error msgs will appear in the logfile.
Old 04-04-2013, 10:48 PM   #3
Registered: Mar 2010
Posts: 353

Original Poster
Rep: Reputation: 0
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.

Old 04-04-2013, 11:15 PM   #4
Registered: Jul 2012
Distribution: Arch, CentOS, OpenSUSE Tumbleweed KDE
Posts: 536

Rep: Reputation: 56
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?
Old 04-05-2013, 04:19 PM   #5
Registered: Apr 2013
Posts: 39

Rep: Reputation: 1
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
Old 04-05-2013, 05:19 PM   #6
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,683

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Most secure way to automatically copy files from Linux to Windows? pingu Linux - Security 3 03-25-2012 03:22 PM
Remote Secure Copy kalyanofb Programming 2 04-20-2007 07:32 AM
Secure Copy carlosinfl Linux - Networking 2 06-09-2006 01:54 PM
forwarding secure copy disorderly Linux - Security 5 12-16-2005 11:48 AM
how can i secure file copy from pc to pc b123coder Linux - Networking 8 11-20-2004 03:56 PM

All times are GMT -5. The time now is 09:20 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration