The Web Local
 

 

 

Unix Information

 

I have put together below a few tips and hopefully some useful information that may help you.

 

Hard Drive Format (DD)

           

dd if=/dev/vrandom of=/dev/sda or hda    (Overwrites hard drive with random characters).

dd if=dev/zero of=/dev/sda or hda            (Overwrites hard drive with zero characters).

grep v e 0 f /dev/sda or hda               (Check to see if all Os have been written, if grep reports nothing, disk is therefore blank).

 

Linking Files in Linux

           

ln s [FILE] [NEW_SHORTCUT_TO_FILE]

-s = Symbolic link, remove if hard link required.

 

History File 

 

history c                                  (Clear all history logs)

HISTFILESIZE =0

export HISTFILESIZE                 (Disables History)

 

IP Tables

           

iptables -[ADC] chain rule-specification [options]
iptables -[RI] chain rulenum rule-specification [options]
iptables -D chain rulenum [options]
iptables -[LFZ] [chain] [options]
iptables -[NX] chain
iptables -P chain target [options]
iptables -E old-chain-name new-chain-name  

 

    -A, --append  (Append one + rules to the end of the selected chain).

    -D, --delete  (Delete one or more rules from the selected chain).

    -R, --replace (Replace a rule in the selected chain).

    -I, --insert  (Insert one+ rules in selected chain as given rule #).

    -L, --list    (List all rules in the selected chain).

    -F, --flush   (Flush the selected chain).

    -N, --new-chain (Create a new user-defined chain of the given name).

    -X, --delete-chain (Delete the specified user-defined chain).

    -P, --policy  (Set the policy for the chain to the given target).

 

Options

    -p, --protocol [!] [TCP, UDP, ICMP, OR ALL]

    -s, --source [!] [IP_ADDRESSS/SUBNET_MASK] i.e. s !192.168.0.1 = Not

    192.168.0.1

    -d, --destination [!][IP_ADDRESSS/SUBNET_MASK]

    -j, --jump [DROP, DENY, ACCEPT]

    -i, --in-interface [!] [INTERFACE] + = Wildcard

    -o, --out-interface [!] [INTERFACE] + = Wildcard

 

Other Options:

    --dport 22 or 1024:6000          (1024-6000)

    --sport 22 or 1024:6000

    --tcp-flags [SYN,ACK,FIN.RST]

 

 

iptables [-t TABLE_NAME] [COMMAND] [CHAIN_NAME] [PARAMETER_1] [OPTION_1] 
[PARAMETER_2] [OPTION_2]

iptables -R INPUT 1 -s 192.168.0.1 -j DROP

iptables -I INPUT 1 --dport 80 -j ACCEPT

iptables-save

iptables-restore

 

Mounting USB

 

mount t vfat /dev/[sda1, sda2, sdb1, sdb2] /MOUNT_POINT

 

Networking

 

route add default gw [IP_ADDRESS]  (Adds default gateway)

 

PATH statements

 

export PATH=$PATH[:/PATH_TO_ADD]

or amend .bash_profile of a particular user.

  

Samba

 

Ensure the following rpms are installed:

Samba-3.xxx.rpm

Samba-common-3.xxx.rpm

Samba-client-3.xxx.rpm

 

chkconfig smb level 35 on

service smb start

 

Edit /etc/samba/smb.conf

Workgroup = [WORKGROUP_NAME]

Server string = [HOSTNAME]

 

Enable some shares i.e. /tmp, unhash all lines

testparm  /etc/samba/smb.conf  (To check all syntax is correct)

Ensure required user in /etc/passwd & /etc/shadow

smbpasswd a [SAMBA_USER]         (Keep the same as Windows credentials)

Service smb restart

 

or of course use the GUI ;-)

 

system-config-samba

 

Trouble-shooting:          IPTables not blocking and VMWare not set to NAT

 

Update Packages

 

Usage:  yum [options] <update | upgrade | install | info | remove | list |

clean | provides | search | check-update | groupinstall | groupupdate |grouplist >

               

Options:

          -c [config file] - specify the config file to use

          -e [error level] - set the error logging level

          -d [debug level] - set the debugging level

          -y answer yes to all questions

          -t be tolerant about errors in package commands

          -R [time in minutes] - set max amt of time to randomly run in.

          -C run from cache only - do not update the cache

          --installroot=[path] - set the install root (default '/')

          --version - output the version of yum

          -h, --help this screen

 

yum update

yum update [PACKAGE1] [PACKAGE2 PACKAGE3...]

yum install [PACKAGE1] [PACKAGE2 PACKAGE3...]

yum remove [PACKAGE1] [PACKAGE2 PACKAGE3...]

 

or use Up2date

 

up2date -i -u --nosig    (Update and install all, do not worry about GPL signatures)

 

From Fedora Core 5 up2date has been deprecated, which is a shame as I found it easy to script and to use.  This has been replaced by the PackageUPdate service (PUP).  This is gui based and it is fire and forget and it will go off to the RedHat site/ mirrors and update all the packages on your box and solve dependencies as it goes.

 

Dell D610 Graphics Problem with Fedora Core 3 & 4

 

With Fedora Core 3 -5 I've encountered a problem with getting X to work out-of-the-box on a Dell Latitude D610 laptop utilising the GM915 Graphics Chipset.  After a normal install the screen goes black on trying to initialise X.  I found the workaround to this is to attach a CRT monitor (TFT didn't work?) to the back of the laptop and pressing the fn and alt screen box.  Hopefully the X windows screen will now display on the CRT monitor.  To get the actual laptop to display X you need to set the screen to use the I815 drivers (not 915 even though the D610 uses the GM915 chipset!!!!) and set the screen display to a Dell Laptop (and an appropriate size).  Restarting X with these parameters will hopefully enable you to use X on your D610 ;-))

 

 

IT Security News:

 

Pen Testing Framework:

 

Latest Tool Reviews: