Posts

Showing posts from 2009

Networking interview questions

CCNA admin interview questions Networking interview questions 1.You need to retrieve a file from the file server for your word processing application, which layer of the OSI model is responsible for this function? 1.Presentation layer 2.Application layer 3.Session layer 4.Transport layer 5.Datalink layer 2.You are working in a word processing program, which is run from the file server. Your data comes back to you in an unintelligible manner. Which layer of the OSI model would you investigate? 1.Application layer 2.Presentation layer 3.Session layer 4.Network layer 5.Datalink layer 3.The IEEE subdivided the datalink layer to provide for environments that need connectionless or connection-oriented services. What are the two layers called? 1.Physical 2.MAC 3.LLC 4.Session 5.IP 4.You are working with graphic translations. Which layer of the OSI model is responsible for code formatting and conversion and graphic standards. 1.Network lay...

Linux BOOT Process

Boot sequence summary When a PC is booted it starts running a BIOS program which is a memory resident program on an EEPROM integrated circuit. The BIOS program will eventually try to read the first sector on a booting media such as a hard or floppy drive. The boot sector contains a small program that the BIOS will load and attempt to pass run control to. This program will attempt to read the operating system from the disk and run it. LILO is the program that Linux systems typically use to give users a choice of operating systems to run. It is usually installed in the boot sector which is also called the master boot record. If the user chooses to boot Linux, LILO will attempt to load the Linux kernel causing the following basic events to happen: BIOS Load boot sector from one of: • Floppy • CDROM • Hard drive The boot order can be changed from within the BIOS. BIOS setup can be entered by pressing a key during bootup. The exact key depends varies, but is often one of D...

Introduction to Linux FTP server

Introduction The File Transfer Protocol (FTP) is used as one of the most common means of copying files between servers over the Internet. Most web based download sites use the built in FTP capabilities of web browsers and therefore most server oriented operating systems usually include an FTP server application as part of the software suite. Linux is no exception. This chapter will show you how to convert your Linux box into an FTP server using the default Very Secure FTP Daemon (VSFTPD) package included in Fedora. FTP Overview FTP relies on a pair of TCP ports to get the job done. It operates in two connection channels as I'll explain: FTP Control Channel, TCP Port 21: All commands you send and the ftp server's responses to those commands will go over the control connection, but any data sent back (such as "ls" directory lists or actual file data in either direction) will go over the data connection. FTP Data Channel, TCP Port 20: This port is used for all subs...

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.

Vim Editor Shortcuts Keys

Linux Shortcuts Keys For vim Editor 1. Go to the first line gg or 1 shift g or :0 (zero) Enter 2. Go to the last line. Shift g or :$ Enter 3. Go to line 8 8 shift g 4. To scroll down one screen Ctrl f 5. To scroll up one screen Ctrl b 6. First position on line 0(zero) 7. Last position on line $ 8. Go to matching parenthesis % 9. Right, left, up, down respectively. l, h, k, j Or You can also use arrow keys 10. Where Am I? Ctrl g ********************** 1. Copying a whole line yy or shift y or :ny where n is the number of line if n is not specified then copy the current line 2. Copying from current position to end of line. y$ 3. Copying 3 lines after the current position 3yy 4. Copying a range of line :1,5y or :1y 5 The above example copy 5 lines, from 1 to 5 5. Deleting a whole line (Deleted line is copy to the registers) dd or :nd Where n is the number of line if n is not specifie...

Installation of Linux version of XAMPP

Image
Step 1: Download you can download Linux version of XAMPP from the give link A complete list of downloads (older versions) is available Step 2: Installation After downloading simply type in the following comm ands: Go to a Linux shell and login as the system administrator root: su Extract the downloaded archive file to /opt: tar xvfz xampp-linux-1.7.tar.gz -C /opt Note: Please use only this command to install XAMPP. DON'T use any Microsoft Windows tools to extract the archive, it won't work. Note : already installed XAMPP versions get overwritten by this command. That's all. XAMPP is now installed below the /opt/lampp directory. Step 3: Start To start XAMPP simply call this command: /opt/lampp/lampp start You should now see something like this on your screen: Starting XAMPP 1.7... LAMPP: Starting Apache... LAMPP: Starting MySQL... LAMPP started. Ready. Apache and MySQL are running. If you get any error messages please take a look at the Step 4:...

Unix/Linux Commands System Info

Date : Shows the current date and Time. Cal : Shows this month's calendar. uptime :  Show current Uptime. W : Displays who is online. whoami : Displays user's information. uname -a : Show Kernal information. cat /proc/cpuinfo : Cpu information. cat /proc/meminfo : Menory information. df : Show disk usage. du : Show directory space usage. free : Show memory and Swap usage  whereis app : Show possible locatins of app which app : show which app will be run by default

Steps for Connecting Airtel Mobile gprs 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 [Modem0] Modem = /dev/ttyACM0 Baud = 115200 SetVolume = 0 Dial Command = ATDT Init1 = ATZ Init3 = ATM0 FlowControl = CRTSCTS [Dialer airtel] Username = a Password = a Phone = *99# Stupid Mode = 1 Init1 = ATZ Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 Init3 = AT+CGDCONT=1,"IP"," airtelgprs. com " Inherits = Modem0 :wq! save and exit STEP 3: #vim /etc/resolv.conf nameserver 202.56.250.5 :wq! save and exit STEP 4: Now open another terminal and run this command #wvdial airtel and minimized it