System HowTo

.procmailrc must NOT be world readable or writeable

When a user wants to filter messages with the ".procmailrc" file, make sure that the file is NOT world readable or writeable. Otherwise forwarding will not work.

Or put another way, make sure ONLY the user has access to the file.

$ ls -la .procmailrc
-rw------- 1 user group 86 Jun 12 10:00 .procmailrc

Virtualize to bypass time based trial software

We all have used at least one piece of trial software that ended after a certain amount of time or a certain date. With virtualization, you can now run some of these applications (or systems) within a virtual environment pretty much forever. When it expires, reload the original snapshot of the software.

Example:

You have a utility similar to PKZip. You will create a bare virtual system with that as the main program. Then make a snapshot or backup the virtual machine.

When the software expires, reload the snapshot or backup.

** Note ** Some virtualization add-ons like VMware Tools can synchronization the time between the host and the guest. Normally this is a good thing. For the purpose of this exercise, do not install these tools. Please do install the necessary tools to optimize the Virtual Machine -- just skip the time synchronization options.

HowTo: Reset the admin password for Gallery

1) Go into the "albums/.users" directory

2) Edit the file that has a number for its filename
example: 1055879304:298113996

$ vi 1055879304:298113996

3) Change the password string to another md5 string

4) To get another md5 string, run this command

$ md5 -s newpass
MD5 ("newpass") = e6053eb8d35e02ae40beeeacef203c1a

HowTo: Second SSH daemon using SMF in Solaris 10

In some cases, it may be a good idea to run separate SSH daemons -- one internal and one external.

Here's how I did it using the new SMF method.

1) New Config

cd /etc
cp -rp ssh ssh_copy
cd ssh_copy
rm ssh_host_*
vi sshd_config

change to desired port
add line for alternate PID i.e. "PidFile /var/run/ssh_copy.pid"

2) SMF method

cd /lib/svc/method

cp -rp sshd sshd_copy

edit the new file using the diff below:

# diff sshd sshd_copy
8c8
< SSHDIR=/etc/ssh
---
> SSHDIR=/etc/ssh_copy
10c10
< PIDFILE=/var/run/sshd.pid
---
> PIDFILE=/var/run/sshd_copy.pid

Restarting SSH remotely

Create a secondary SSH daemon for backdoor access during special management of server.

1) Start sshd backdoor:

/usr/sbin/sshd -p 22222

You will have two instances of sshd running now.

2) Login back in using the 22222 port backdoor:

ssh -p 22222 user@server.com

3) Find the old running sshd and kill it:

ps auxww | grep ssh
kill -9 [pid]

4) Start the new daemon on standard port:

/usr/sbin/sshd -4

5) login in using the standard port 22. and kill the sshd on 22222:

ssh -p 22 remote@host.com
ps auxww | grep ssh


Copyright © 1999-2008 Damond Choi. All rights reserved.
Syndicate content