Solved

AIX Crontab NULLED

Posted on 2014-02-28
7
508 Views
Last Modified: 2014-02-28
As root on an AIX server a user ran a command "crontab" and pressed enter. As soon after he did this he did a "Ctrl z", This seems to have nulled the root crontab file. Is this possible, What is the explanation behind this.

I replicated the issue on a different server but root crontab entries were intact. So just by running "crontab" will this null the file, as I know that "crontab -e" does editing of crontab, "-e" option was not specified.
0
Comment
Question by:aanya247
  • 3
  • 3
7 Comments
 

Author Comment

by:aanya247
ID: 39894914
$ crontab
[1] + Stopped (SIGTSTP)        crontab
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 300 total points
ID: 39894937
crontab alone opens an empty file for editing. Upon exit this file overwrites the original crontab.

ctrl-z alone cannot null a file. The user must have issued a write command, such as ":wq" or ":x" or "ZZ".

Could it be that it wasn't "ctrl-z" but "shift-zz"?
0
 
LVL 5

Assisted Solution

by:Dave Gould
Dave Gould earned 200 total points
ID: 39895109
ctrl-z just suspends the vi process. If the user types "jobs" he should see that the process is still there and can bring it back to the foreground by typing fg.
This should bring him back to the vi process which he can simply force quit (:q!)

It is possible that this advice is a bit late if the user has already logged out.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:aanya247
ID: 39895222
Its Too late now... :) thank you that is something which I did not think.
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 39895238
ctrl-z alone will never destroy a file, I keep telling you.

Test: Issue "crontab", then hit ctrl-z, then issue "exit" twice.
Log in again and you will find the crontab unchanged.

And are you aware that "crontab -r" will delete the crontab without asking for confirmation?
0
 

Author Comment

by:aanya247
ID: 39895317
Wmp
Ur solutions are very valuable and I learn a lot from them, I understood from the first comment that Ctrl Z, will not delete but I never knew that jobs is a command that can be run to find out.

So I am sorry for the distribution of points and I know that ur first comment solved my question .

Thanks again
Aanya
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 39895351
Never mind, I'm always glad to help, regardless of the points.

Thx for them!

wmp
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now