Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #############################
- # GNUPG
- #############################
- # generate a keypair
- gpg --gen-key
- # export ones public key
- gpg --armor --output pubkey.txt --export 'My name'
- # send the key on the server (easier with kgpg)
- gpg --send-keys 'My name' --keyserver hkp://subkeys.pgp.net
- # import someone else's key
- gpg --import key.asc
- gpg --search-keys 'tnagy1024@gmail.com' --keyserver hkp://subkeys.pgp.net
- # encrypt a file
- gpg --encrypt --recipient 'tnagy1024@gmail.com' foo.txt
- # decrypt a file
- gpg --output foo.txt --decrypt foo.txt.gpg
- #############################
- # LINUX
- #############################
- # partition creation using ‘dd’
- dd if=/dev/urandom of=/root/linux.bin bs=1024k count=278
- dd if=/dev/zero of=/root/linux.bin bs=1024k count=4489 (dvd R)
- dd if=/dev/zero of=/root/linux.bin bs=1024k count=4450 (dvd RW)
- dd if=/dev/zero of=/root/linux.bin bs=1024k count=700 (cdrom de 700 Mb)
- # filesystem creation
- mkfs -t ext2 /dev/loop0
- tune2fs -m0 -c0 -i0 /dev/loop0
- # script for mounting the volume
- #! /bin/sh
- DEVICE=/root/linux.bin
- sudo /sbin/modprobe cryptoloop
- sudo /sbin/modprobe aes
- sudo /sbin/losetup -eaes256 -C7 /dev/loop0 $DEVICE
- sleep 1
- sudo mount /dev/loop0 /crypt
- # script for unmounting
- #! /bin/sh
- sudo umount /crypt
- sudo /sbin/losetup -d /dev/loop0
- #############################
- # SSH
- #############################
- # Key creation
- ssh-keygen -t rsa
- then copy ~/.ssh/id_rsa.pub on the remote server
- # To avoid retyping the password over and over again, edit ~/.profile
- SSHAGENT=/usr/bin/ssh-agent
- SSHAGENTARGS="-s"
- if [ -z "$SSH_AUTH_SOCK" -a -x "$SSHAGENT" ]; then
- eval `$SSHAGENT $SSHAGENTARGS`
- trap "kill $SSH_AGENT_PID" 0
- fi
- # for the fist time, call:
- ssh-add ~/.ssh/id_dsa
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement