System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

How to truncate the wtmp file

SOLVED
Go to solution
Timothy P. Jackson
Valued Contributor

How to truncate the wtmp file

Hi everyone,

 

I am working on my slow SSH connection. After reading many posts, it appears that it could be the wtmp file. Is using the runacct command the best way to truncate this file.

 

Any help would be greatly appreciated.

 

Thanks!

 

Tim

5 REPLIES
Dennis Handly
Acclaimed Contributor

Re: How to truncate the wtmp file

You can truncate by just using the shell:

> /var/adm/wtmp

> /var/adm/wtmps

 

How large are your wtmp files?

 

Timothy P. Jackson
Valued Contributor

Re: How to truncate the wtmp file

Hi Dennis,

 

Thanks for the reply!

 

the size of the /var/adm/wtmp is 173280....

 

I don't think it is the too large but I have to start somewhere in trying to figure out why this is so slow....

 

I will try clearing them and see what happens. Can I do this with users on the server?

 

Timothy P. Jackson
Valued Contributor

Re: How to truncate the wtmp file

Ok I spoke to soon!

 

The size of /var/adm/wtmps is 2193489044.... This one is very large...

Dennis Handly
Acclaimed Contributor
Solution

Re: How to truncate the wtmp file

>The size of /var/adm/wtmps is 2,193,489,044. This one is very large.

 

Yep!

Do you have any security or accounting reasons to keep some of that info?

Or you can just backup a compressed copy before you clear it.

Timothy P. Jackson
Valued Contributor

Re: How to truncate the wtmp file

No reason to keep the information around...

 

Thanks for all your help Dennis!