Posts

The Linux Boot Sequence

You might remember when you installed Linux that the installation process prompted you for a list of partitions and the sizes of each in which your filesystems would be placed. When allocating disk space for the partitions, the first sector, or data unit, for each partition is always reserved for programmable code used in booting. The very first sector of the hard disk is reserved for the same purpose and is called the master boot record (MBR). When booting from a hard disk, the PC system BIOS loads and executes the boot loader code in the MBR. The MBR then needs to know which partitions on the disk have boot loader code specific to their operating systems in their boot sectors and then attempts to boot one of them. Fedora Linux is supplied with the GRUB boot loader which is fairly sophisticated and therefore cannot entirely fit in the 512 bytes of the MBR. The GRUB MBR boot loader merely searches for a special boot partition and loads a second stage boot loader. This then reads...

How can I prevent users from connecting to a USB storage device? in Windows OS

It is easy to lock a machine down, disable the floppy, and cdrom in the bios. There is a simple registry change that will keep the USB storage drivers from starting when the system boots. Keeps people from walking up to a PC and copying data off with a USB key, but allows you to keep your scanner, keyboard, and mouse working. As always - back your system up before messing around in the registry. Just open regedit and browse to this key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor Notice the value 'Start' Switch this value to 4, and USB storage devices are disabled. Switch this value to 3, and USB storage devices are enabled. Hence you have Prevented users from connecting a USB device

Hardening Linux Server

Some Steps Installation of Linux OS Install the OS with minimal installation, then proceed to install only the required packages. Removing the unwanted packages in os like gnome, kde,games,Openoffice not needed for server configuration. Securing the Bootloader Grub should be configured with password Restrict access to Server /etc/hosts.allow and /etc/hosts.deny should be configured Modify /etc/hosts.allow Suggested format: # Approved IP addresses ALL: 192.168.0.1 ALL: 192.168.5.2 # CSV uploader machine proftpd: 10.0.0.5 # pop3 from anywhere ipop3: ALL Modify /etc/hosts.deny ALL:ALL EXCEPT localhost:DENY Securing SSH vi /etc/ssh/ssh_config change the following protocol 2,1 to protocol 2 PermitRootLogin yes to PermitRootLogin no Restart SSHD: /etc/rc.d/init.d/sshd restart Setting SSH Banner for the making user to consent to the terms & conditions # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #****************...

Service Start And Stop /Directory Path and Port Number

Service ssh Application Startup directory /etc/init.d/ Startup Method service sshd start Log file /var/log/secure Ports 22 *************************************************** Service snmp Application Startup directory /etc/init.d/ Startup Method service snmpd start Log file /var/log/snmpd.log Ports 199 *************************************************** Service httpd Application Startup directory /etc/init.d/ Startup Method Service httpd start Log file var/loh/httpd/access.log Ports 80 *************************************************** Service dhcpd Application Startup directory /etc/init.d/ Startup Method Service dhcpd start Log file /var/log/dhcpd.log Ports 67 *************************************************** Service DNS Application Startup directory /etc/init.d/ Startup Method Service named start Log file /var/log/messages Ports 53 *************************************************** Service Mysql Applicati...

Steps for Connecting TATA INDICOM internet (Plug 2 surf Whiz) in Linux pc

STEP 1: now open the file #vim /etc/wvdial.conf STEP 2: erase all the content of this file and paste following lines #[Dialer Defaults] #Phone = #777 #Username = internet #Password = internet #New PPPD = yes [Dialer Defaults] Modem = /dev/ttyACM0 Baud = 115200 Setvolume = 0 #Dial Command = ATDT Init1 = ATZ #Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 Modem Type = Analog Modem FlowControl = Hardware (CRTSCTS) [Dialer Defaults] #ISDN = 0 Modem Type = Analog Modem Username = internet Password = internet Phone = #777 Stupid Mode = 1 #Init1 = ATZ #Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 #Inherits = Modem0 :wq! save and exit STEP 3: #vim /etc/resolv.conf nameserver 203.197.12.30 nameserver 202.54.1.18 :wq! save and exit STEP 4: Now open another terminal and run this command rajesh@rajesh:~$ wvdial --> WvDial: Internet dialer version 1.60 --> Cannot get information for serial port. --> Initializing modem. --> Sen...

linux questions

1. Q. How do you list files in a directory? A. ls - list directory contents ls (-l use a long listing format) 2. Q. How do you list all files in a directory, including the hidden files? A. ls -a (-a, do not hide entries starting with .) 3. Q. How do you find out all processes that are currently running? A. ps -f (-f does full-format listing.) 4. Q. How do you find out the processes that are currently running or a particular user? A. ps -au Myname (-u by effective user ID (supports names)) (a - all users) 5. Q. How do you kill a process? A. kill -9 8 (process_id 8) or kill -9 %7 (job number 7) kill -9 -1 (Kill all processes you can kill.) killall - kill processes by name most (useful - killall java) 6. Q. What would you use to view contents of the file? A. less filename cat filename pg filename pr filename more filename most useful is command: tail file_name - you can see the end of the log file. 7. Q. What would ...

Compression and Extract Files

tar -cfv filename.tar directoryname TAR indicates "Tape Archive", The -c means “create”, -v means “verbose” and the -f indicates that a filename will follow (filename.tar) tar -tvf filename.tar Typing this command will result in a list of the contents of the tar file. tar -xvf filename.tar command used to “extract” a tar file. use -x to “extract” instead of the -c used to create. gzip filename.tar This command is used for compression. the filename will automatically change from filename.tar to filename.tar.gz gunzip filename.tar.gz This command (g”unzip”) is used to uncompress a .tar.gz file tar -xzvf filename.tgz This command is used to uncompress and extract the files from a .tgz archive.