LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 04-04-2013, 07:01 PM   #1
sysmicuser
Member
 
Registered: Mar 2010
Posts: 458

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
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,348

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
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.
 
Old 04-04-2013, 10:48 PM   #3
sysmicuser
Member
 
Registered: Mar 2010
Posts: 458

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.

dmesg?
 
Old 04-04-2013, 11:15 PM   #4
ilesterg
Member
 
Registered: Jul 2012
Location: München
Distribution: Debian, CentOS/RHEL
Posts: 587

Rep: Reputation: 72
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
H5X00R
Member
 
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 http://www.cyberciti.biz/tips/howto-...ccounting.html
 
Old 04-05-2013, 05:19 PM   #6
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

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


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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