Posts Tagged ‘old friend’

Linux: /var/log/wtmp – No such file or directory quick fix and why it might be missing on a server

Thursday, May 4th, 2017

fix-var-log-wtmp-btmp-no-such-file-or-directory-linux_last_command-howto-quick-fix

If you have to occasionally log  into some client old inherited (not installed by you) Linux servers on and just out of curiosity and for security sake dediced do a quick security (last user login) evaluation, e.g. issued the
last command just to find out you get the error:

last: /var/log/wtmp: No such file or directory

Perhaps this file was removed by the operator to prevent logging last info.

Then this might be a sure indicator that some malicious script kiddie (hax0r) activity has been run over the server or the ex-system administrator if fired recently decided to wipe out all his login tracks among with installing some other nasty rootkit or backdoor.

Under some circumstances the error might be caused also by badly written end user rotate script bugs (like shell or perl script) bugs or by a buggy deployment of Linux OS virtual machine.
The last: /var/log/wtmp: No such file or directory error is likely to happen on Ubuntu / Debian / Redhat / CentOS Linux distributions running on a Cloud PaaS service such as Amazon EC2, some of the Cloud services vendors do choose to explicitly remove /var/log/wtmp for the reason that many of end customers are using their Linux VM servers (Xen Virtualization / OpenVZ / LXC – Linux Containers) etc. irresponsibly and hence become a victim of script kiddie attacks and the failed logins attempts logged in /var/log/wtmp grow to many gigabytes.

Even some Linux distributions or system administrators of Linux server login hosts that has to keep tens of thousands of  login records monthly or are concentrating on simplicity and on an attempt to reduce size has purposefully deleted the last login entry file /var/log/wtmp file to save space.

But anyways if you happen to be missing this file always bear in mind that you might have been a victim of intrusion and you better run chkrootkit and rkhunter

Run below commands to fix the missing /var/log/wtmp

touch /var/log/wtmp
chmod 0664 /var/log/wtmp
chown root:utmp /var/log/wtmp

On some Linux distributions such as Ubuntu and Fedora you might also want to create /var/log/btmp (which is used to log failed login attempts to server)

touch /var/log/btmp
chmod 0664 /var/log/btmp
chown root:utmp /var/log/btmp

Once the files are created the last command will start logging server in logins and logouts as it is supposed to be again, e.g.:
 

linux:~# last -15
root pts/0 192.168.0.15 Fri May 5 16:41 still logged in


This article was inspired by a prior article found on root.bg the site is in Bulgarian so unfortunately you might not be able to read it, but as a content and concept it is pretty similar to www.pc-freak.net, actually the site author Nikolay Nikolov (known in Internet Relay Chat IRC under the pseudonym Joni-B, happened to be an old friend from youth geek IT years 🙂

Enjoy

My pleasent time back home in Bulgaria

Sunday, January 4th, 2009

I experienced mostly a great time in Bulgaria. Refreshing days went to Kavarna with Nomen to confess my sins in front of a priest. I purposely has selected Kavarna’s Church and father “Vasilii” because I liked him as a priest. I’ve been on a liturgy once during the summer in the church where he takes care for. After the Liturgy I drived Mitko’s Audi A3 towards Dobrich. I’m a new driver so I need to practice. I drived during this days few more times. We went several times for a coffees and pubs with Nomen and Alex. We also went out with Nicki Mitko’s brother a couple of times and we had a great time together coffee-ing. I also went to a dentist. It seems that I had caries and they had to fix my teeth. The caries was in the last stage that it could be so the dentist had to kill and remove my nerve and he did so, the nerve was killed (with arsenic fluid) and removed and the tooth was filled in. I also went out for a drink 3 times with Lily. I went to liturgy 2 times. I met a nice priest (Father Veliko). In Varna when I came back from the Netherlands I met Order and had a great time with him. A lot of other things that I can hardly remember. The Christmas this year. My whole family was there except my grandma who had to be in the hospital (however the Christmas was just perfect!) Thanks to God! I and my family gathered together and had a nice talk and dinner even we said the Lord’s prayer before we started eating it was so nice … The New Year eve was a nice one as well. Even my grandma was there. If we don’t count few minor downfalls like a small quarrel with my sis all went well. I was home with my family until 1.30 in the morning and afterwards went to Denica’s who is a close friend of Nomen, Pavlin was there as well he is an old friend from the metal days of my past. I drinked a couple of glasses of beer and wine. In the morning I had a little hang-over as as a consequence from the drinking. The 13 days I was in Bulgaria has passed so quickly. I shared with my grandma and mother that I feel bad physically, emotionally and mentally. During my stay I also have been aguest in my aunt a couple of times, so nice time there as well.The food in Bulgaria is so great I was very, very happy to eat the delicios food there. The food here in the Netherlands is completely terrible compared to the one at home! In short that was how my days passed there. And I’m so happy about them! I’m looking forward to go home as fast as possible I realize my place is not abroad. When I firstly came here I thoiught that maybe my place is somewhere in some of the developed countries like here in The Netherlands. Now I think differently. It’s quite interesting that after I went out of Bulgaria I became much more a patriot. When I was living there I always has praised the developed countries way of living and thinking. Now it’s a completely different story I sometimes even like the bad things in Bulgaria. I wonder if other people who went out of Bulgaria to work or study has experienced the same.Anyways thanks to the Lord I had a safe journey from Bulgaria to the Netherlands. And here I’m here in the dorm again. I’m gonna tell in short my experiences from the trip back from Bulgaria to the Netherlands in a different post in a minute.END—–

Thanks to God, yesterday I had a great day

Thursday, June 28th, 2007

Yesterday was a good day in general. Ofcourse as ever thanks to God. The day before yesterday I was feelingbad and I prayed asking of God something to become happening in my life. Yesterday Pro-XeX called and we drinked a coffee on The Fountain coffee with him and Amridikon. I received only one call from the Office for the whole day and later Bino an old friend come home and was my guest for few hours, in the evening, we met with Nomen and we decided we would watch a film on the Cinema. The Film that was projected wascalled “The Pirates of Carribbean Sea“, the film was empty of meaning just a tale I wasn’t able to get mostof the conceptions of the film it was just things happening all around the film an action happenning with some elements of humour. After that I send Nomen to his home and went home. I prayed with the Evening Orthodox Prayers as usual and as usual after that prayed with my own prayer for people I wish that God would give a hand. Today I red about the living of a saint Seraphim Sarov who used to live in russia. His life story is quite interesting, His teaching of the purpose of a Christian was absolutely truthful,  what he said in his teaching was something I was all the time knowing. He said the Purpose of a Christian life is to be fulfilled and with the Holy Spirit staying in The Body of Christ Jesus, great truth, I read a documented conversation between the saint and an ordinary Russian citizen, st. Seraphim Sarov explained in this conversation how to recognize if we are fulfilled with the Holy Spirit and through this in Jesus Christ body. His explanation was something which I also know from experience so I know this saint is speaking of a Truth. When I was reading his documented with his speech I was feeling the presence of God so near. And was feeling exactly what st. Seraphim said a man feels in the Presence of The Holy Trinity!

Praise be to God Almighty!