Script to grab all the domain groups for a user on a Linux system with Active Directory connection

#!/bin/sh clear USIDTEMP=”/var/tmp/USIDstr.tmp” GSIDTEMP=”/var/tmp/GSIDstr.tmp” NAMETEMP=”/var/tmp/NAMEstr.tmp” #Reseting String storage veribles >$USIDTEMP >$GSIDTEMP >$NAMETEMP echo “command line to usergroup checker please supply the domain you wish to check” read DOM DOMAIN=$(echo $DOM | tr [a-z] [A-Z]) clear echo “What username do you wish to list groups for?” read USERNAME clear USERSID=$(WINBINDD_SOCKET_DIR=/var/samba/$DOMAIN/ wbinfo –name-to-sid=$USERNAME &> $USIDTEMP) echo “checkContinue reading “Script to grab all the domain groups for a user on a Linux system with Active Directory connection”

Common Linux Commands

#ping google.com #ping -I ethF 192.168.1.1 (from a particular source interface) #traceroute google.com #/sbin/ifconfig (all active network interfaces and some interface statistics)(add or change IP addresses) # ifconfig -a # ip addr #setup (to change the default interface or changing the interface IPs etc) #reboot #clear (to clear the screen) #ip neigh flush all (clearContinue reading “Common Linux Commands”

To add a route on the windows machine to force route the traffic through a particular gateway when two connections are connected on it

c:/>route ADD “network” MASK “subnet mask” “gateway ip” c:/>route ADD 8.8.8.8 MASK 255.255.255.0 192.168.1.12 or c:/>route ADD 10.10.10.0 MASK 255.255.255.0 192.168.1.12

To mount a USB under the linux shell (USB should be in FAT32 and it should the first partition as FAT32)

#tail -f /var/log/messages-2014-10-23 (to see which directory it is read as e.g. /dev/sdb1 , once plugged in) #cat /proc/partitions (to see which /dev/ directory it is plugged into) or #fdisk -l #mkdir /tmp/usb (create a mount point) #mount /dev/sdb1 /tmp/usb #cp /var/archive/backup123. /tmp/usb #unmount /tmp/usb

System information commands

#vmstat (summary information for system load and usage, but does not show individual processes) #ps aux (display all processes running on the Linux system)(to search for specific processes or list them all) #ps aux | grep auth (all the processes that have auth in them) #ps auxf | sort -nr -k 4 | head -10Continue reading “System information commands”