Tuesday, February 26, 2013

Essential Linux Command used

As job require, I've been involve in setting LDAP server in Linux environment. As a newbie in Linux, I think it's a good idea for me to keep some of the essential command somewhere i can access anytime anywhere.

Mounting USB Drive
1. Checking what device id been assigned to newly plugin usb drive
    -"dmesg"
    -cat \proc\partitions
2.  create folder for mounting the USB drive
    - mkdir \mnt\usb
3. mounting the USB drive
    - mount -t vfat /dev/[device id] /mnt/usb
4. unmount the USB drive
    - umount /mnt/usb

Mounting an encrypted Volume
1. cryptsetup --key-file /root/key/backup luksOpen /dev/sdb1 backup
2. mount /dev/mapper/backup /mnt
3. umount /mnt
4. cryptsetup luksClose backup

Configure network
 1. check for interface
    - ifconfig -a
2. configure hw mac address accordingly
    - vi /etc/udev/rules.d/70-persistent-net.rules.
    - vi /etc/sysconfig/network-scripts/ifcfg-eth0
 3. restart network service to acquire ip
    - service network restart

View Cert
- openssl asn1parse -inform PEM -in [cert.pem]
Generate a cert with private key
- openssl req -new -x509 -nodes -out /etc/openldap/ssl/slapdcert.pem -keyout /etc/openldap/ssl/slapdkey.pem -days 365
 
Services
- Restart Services : service [service name] restart
- check service status : service [service name] status 

No comments: