I was trying to create a user today in samba and was getting the error "Failed to modify password entry for user [USER]".
I read over the man pages for smbpasswd and saw that I needed to add the -n switch because this user will not have a password. So again I tried to add the user with "smbpasswd -a -n [USER]" and got the same error.
A quick Google search lead me to a newb mistake on my part... I didn't have the user I was trying to add in my UNIX password file. A quick "useradd [USER]" followed by the same "smbpasswd -a -n [USER]" and I was all set.
Granted there are other reasons why this process might fail, but for me this was the reason.
Wednesday, May 27, 2009
Friday, May 22, 2009
A simple file shredder for Windows
Working with sensitive data all day long you come to realize that what I download needs to be deleted securely, just as the paper copies need to destroyed securely.
I happened upon this script on Lifehacker a while ago, but I have been using it more and more lately.
First you will need to download sdelete from Microsoft. I copy this exe to the Windows directory on each machine as part of my install process.
The script if very simple:
@echo off
FOR %%F IN (%1 %2 %3 %4 %5 %6 %7 %8 %9 %10) DO sdelete -p 7 -s %%F
I save this as shred.cmd and place it in my C:\Scripts folder. It will take up to 10 files at a time and run sdelete with 7 passes on each file. Sdelete will also rename the file 26 times to obfuscate the file name.
About once a month I will run sdelete -p 3 -z to clean the free space on my PC and to make sure that any temp files I didn't shred are cleaned up. Now this won't obfuscate the file names at all, but the contents of the files are gone for good.
You can also place a short cut to the shred.cmd file into your Send To menu options and have an easy way to clean files from any folder.
I happened upon this script on Lifehacker a while ago, but I have been using it more and more lately.
First you will need to download sdelete from Microsoft. I copy this exe to the Windows directory on each machine as part of my install process.
The script if very simple:
@echo off
FOR %%F IN (%1 %2 %3 %4 %5 %6 %7 %8 %9 %10) DO sdelete -p 7 -s %%F
I save this as shred.cmd and place it in my C:\Scripts folder. It will take up to 10 files at a time and run sdelete with 7 passes on each file. Sdelete will also rename the file 26 times to obfuscate the file name.
About once a month I will run sdelete -p 3 -z to clean the free space on my PC and to make sure that any temp files I didn't shred are cleaned up. Now this won't obfuscate the file names at all, but the contents of the files are gone for good.
You can also place a short cut to the shred.cmd file into your Send To menu options and have an easy way to clean files from any folder.
Adding programs to the "Send To" menu
From time to time I write small scripts that accept Command line arguments. In the past I kept shortcuts to them on my desktop, but today I wanted to remove all icons from my desktop.
If you open up %APPDATA%\Microsoft\Windows\SendTo in Windows Explorer.
Let's say you wanted to add an item to the Send To menu to shred files with sdelete. You could just drag a shortcut to the shred script this folder, or create a new shortcut.
If you open up %APPDATA%\Microsoft\Windows\SendTo in Windows Explorer.
You see %APPDATA% is an environment variable that usually maps to something like C:\Documents and Settings\[YOUR USER PROFILE]\Application Data\ in Windows 2000/XP and "C:\Users\[YOUR USER PROFILE]\Application Data\" in Windows Vista.
Let's say you wanted to add an item to the Send To menu to shred files with sdelete. You could just drag a shortcut to the shred script this folder, or create a new shortcut.
This method should work for any application that allows you to open a file by using a command line argument.
Wednesday, May 06, 2009
mail command returns fseek Invalid argument, panic temporary file seek
Today I logged into one of our older servers, haven't logged into it for a while and saw that there was new mail (as always given the number of cron jobs running).
Below is the output of my command.
[root@server /]# mail
"/var/spool/mail/root": 1832 messages 1777 new 1832 unread
fseek: Invalid argument
panic: temporary file seek
After a little bit of searching online I found two possible and simple solutions.
If you want to read the mail try using mutt instead of mail. It doesn't have a problem with the 2GB file size of the mail box that mail did.
If you don't care about the old stuff you can run:
rm -f /var/spool/mail/root
to remove the file and then
cat /dev/null > /var/spool/mail/root
to recreate a blank file.
I ended up reading the mail I wanted and then blowing the file away. But before I could recreate it there was already a new file with 62MB of mail in it.
Thursday, April 23, 2009
Excluding Directories from updatedb on CentOS 5
Running the updatedb command will update the slocate database. However if you want to exclude certain directories for any reason, such as not wanting to include a huge NFS file store or something to that affect you have two options.
1) use the -e switch with a comma seperated list of directories to not index. (updatedb -e /Storage,/home)
2)edit the /etc/updatedb.conf file.
- vi /etc/updatedb.conf
- find the PRUNEPATHS section and add the directories to the list seperated by spaces. (PRUNEPATHS = "/afs /media /net /sfs /tmp /udev /var/spool/cups /var/spool/squid /var/tmp /Storage /home")
man updatedb
Friday, March 20, 2009
error: can't create transaction lock on /var/lib/rpm/__db.000
I got the error message today while upgrading Webmin. The fix for this is pretty simple:
rm -f /var/lib/rpm/__db.0*
rpm --rebuilddb
The first command clears out any of the files that will lock an RPM from running. The second command rebuilds the RPM database.
Then I was able to install Webmin 1.470 from the RPM that I had downloaded with:
rpm -Uhv /Storage/rpmDownloads/webmin-1.470-1.noarch.rpm
Labels:
CentOS,
Fedora Core,
Linux,
programming,
skills,
Tools
Tuesday, February 17, 2009
memcached init.d statup scripts for CentOS 5.2.
While working to setup memcached on my CentOS servers I came across these scripts. They are the typical startup, restart, shutdown, status scripts I am sure you are used to using.
I found them on both http://www.dev411.com/wiki/Memcached_startup_files_for_Red_Hat_(RHEL) and http://www.vbseo.com/blogs/danny-bembibre/daemon-scripts-memcached-44/.
Both sites have the same script contents but I feel that vbseo.com has the more complete instructions.
Subscribe to:
Posts (Atom)