encrypting files using openssl

encrypt file.txt to file.enc using 256-bit AES in CBC mode

openssl enc -aes-256-cbc -salt -in file.txt -out file.enc

the same, only the output is base64 encoded for, e.g., e-mail

openssl enc -aes-256-cbc -a -salt -in file.txt -out file.enc

decrypt binary file.enc

openssl enc -d -aes-256-cbc -in file.enc

decrypt base64-encoded version

openssl enc -d -aes-256-cbc -a -in file.enc


thanks Mark, http://bolusmjak.posterous.com/

Filed under  //

Comments [0]

5 lines every sshd config should contain

to begin to properly secure your linux computer with ssh your sshd configuration file should contain the lines below.  These lines prevent root access, force public key authentication (no password to crack) and restrict access to named users only.

PermitRootLogin no
PasswordAuthentication no
RSAAuthentication yes
PubkeyAuthentication yes
AllowUsers babyman evan

Filed under  //

Comments [1]

find every file modified between to dates

the following will find every file changed between 2 timestamps
touch temp -t 200910011130
touch ntemp -t 200910011630
find / -cnewer temp -and ! -cnewer ntemp

Filed under  //

Comments [0]

snow leopard screen saver password delay

use the following to set the time between when screen saver activates and when a password is required to access the computer, the time is in seconds (10 in this case)

defaults -currentHost write com.apple.screensaver askForPasswordDelay -int 10

Filed under  //

Comments [0]

yoga etiquette tip #3

place your mat on the floor and unroll it, do not drop it, that huge CRACK! is not cool, ever!!! (for more on cracks see tip #1). If you are taking a hot yoga class try rolling your towel up in your mat when you're preparing your stuff the night before.

Filed under  //

Comments [0]

verifying a computers listening ports using nmap

one of the most reliable ways to determine which ports are accessible on a computer is to use nmap

nmap -sT -O localhost

alternately

netstat -an
lsof -i

but since these commands do not connect to the actual computer ports they are less reliable

Filed under  //

Comments [0]

show installed packages using rpm

the following command will sort and show all of the rpm packages installed on a computer using less

rpm -qa | sort | less

Filed under  //

Comments [0]

nmap

ever wonder what the IP address of that server in the corner is, you could always try scanning your network for computers using nmap.

sudo apt-get install nmap

to scan for running computers, here using sudo is optional but will provide more information, all others require root privileges

<sudo> nmap -sP 192.168.1.1/24

to scan for open ports on a computer

sudo nmap -sS 192.168.1.1/24

to include open ports and operating system information

sudo nmap -O 192.168.1.1/24

Filed under  //

Comments [0]