Photobucket

Enter your email address:

Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Port Numbers ( LINUX )

0 comments Tuesday, August 24, 2010


PORT NUMBERS
 




PORTS NUMBERS : Just as the physical address (MAC address) and the logical address (IP address) helps to route the traffic to a particular machine on a network, it is the port that identifies which service on the machine this traffic is destined to.

List of ports /etc/services

A port on a specific computer is called a socket. It can be open, closed, listening or have a connection established.





###Important PORT NUMBERS to remember:

20      -  FTP - data transfer
21      -  FTP - control (command)
22      -  SSH 
23      -  Telnet
25      -  SMTP
37      -  Time
43      -  WHOIS




42      -  WINS
53      -  DNS
67      -  BOOTp
68      -  DHCP
69      -  TFTP
79      -  FINGER
80      -  HTTP (WWW)
88      -  Kerberose
101    -  HOSTNAME 
110    -  POP3
111    -  rpcbind
119    -  NNTP   
123    -  NTP (Time)
137    -  NetBios (nmbd)
139    -  NetBios ( Samba)
143    -  IMAP/Dovecot
161    -  SNMP
180    -  RIS
220    -  IMAP3
389    -  LDAP
443    -  HTTPs
500    -  Internet Key Exchange (IKE), IPSec
520    -  RIP




546    -  DHCPV6 client
547    -  DHCPV6 server
554    -  rtsp(Real Time Stream Protocol, Audio/Video)
631    -  Printing (ipp)
744    -  Flexlm
901    -  SWAT
953    -  rndc
993    -  IMAPSecure
995    -  POPs
999    -  POP over SSL/TLS
2049  -  NFS
2082  -  CPANEL
2083  -  CPANEL Secure SSL/TLS
2086  -  CPANEL WHM 
2087  -  CPANEL WHM Secure/SSL
2095  -  CPANEL Webmail




2096  -  CPANEL Webmail Secure/SSL
2222  -  Direct Admin Control Panel
2401  -  CVSP server
3268  -  AD Global Catalog
3269  -  AD Global Catalog over SSL
3306  -  MySQL Server
3389  -  Terminal services (rdp-remote desktop protocol)
4643  -  Virtusso Power Panel
(6000 -  X11
6063)
8443  -  Pleask Control Panel
9999  -  Urchin
10000-  Webmin Control Panel
21018-  Skype





**********************************************************
**********************************************************
Read On

Apt-Get command line tool (Linux)

0 comments


Apt-Get command line tool 
(Ubuntu's Advanced Packaging Tool) !!!




The apt-get command is a powerful command-line tool used to work with Ubuntu's Advanced Packaging Tool (APT) performing such functions as installation of new software packages, upgrade of existing software packages, updating of the package list index, and even upgrading the entire Ubuntu system.

*Install package
#sudo apt-get install packagename

*Remove Package
#sudo apt-get remove packagename

*Install Multiple Packages
#sudo apt-get install packagename1 packagename2 packagename3




*Update the Package Index
#sudo apt-get update

The APT package index is essentially a database of available packages from the repositories defined in the /etc/apt/sources.list file.

*Upgrade the system
#sudo apt-get upgrade

*Read Debian APT User Manual
#sudo apt-get help





*********************************************************
*********************************************************
Read On

YUM - Yellowdog Updater, Modified (Linux)

0 comments Monday, August 23, 2010


YUM - Yellowdog Updater, Modified





The Yellowdog Updater, Modified (YUM) is an open-source command-line package-management utility for RPM-compatible Linux operating systems and has been released under the GNU General Public License.

Copy/Backup the RHEL5 DVD on the local hdd.

Mount DVD drive:

#mount /dev/cdrom /media





Now copy all the files from the DVD disk to the local Hard disk drive

#mkdir /var/ftp/pub/rhel5

#cp -avf /dev/media/* /var/ftp/pub/rhel5

To configure YUM server, following rpm's and services are required:


1.vsftpd->vsftpd-2.0.5.10.el5.i386.rpm

a). Run vsftpd rpm

#rpm -ivh vsftpd-*.rpm





b). iptables -I INPUT -p tcp --dport 20 -j ACCEPT

iptables -I INPUT -p tcp --dport 21 -j ACCEPT

iptables -I INPUT -p udp --dport 21 -j ACCEPT

iptables -I INPUT -p udp --dport 20 -j ACCEPT

c). For SELinux

setsebool allow_ftpd_full_access on

d). open the file :- vim

#vim /etc/sysconfig/iptables-config and modify below mention line

IPTABLES_MODULES="ip_conntrack_netbios_ns ip_conntrack_ftp"





Now your ftp server is ready to take the responsibilty of yum server.

2.createrepo -> createrepo-0.4.11-3.el5.noarch.rpm

#cd /var/ftp/pub/rhel5/Server

#rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm

#cd..

#createrepo -vg /var/ftp/pub/rhel5/Server/repodata/comps-rhel5-server-core.xml Server

*****ON CLIENT MACHINE*****

#vim /etc/yum.repos.d/rhel-debuginfo.repo
[reposfile]
name= Updates
baseurl=ftp://ipaddress/pub
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY





Eg: #vim /etc/yum.repos.d/client.repo
{*you can use the following lines if configuring on a local PC*}
[server]
name=YUM configuration for the client PC
baseurl=ftp://127.0.0.1/pub/rhel5/Server
gpgcheck=0

====>>>>press esc key and type ->:wq - to save the file and exit from vim





******************************************
 ****************************************** 
Read On

Disk Quotas - Red hat Linux

0 comments


Disk Quotas




Disk space can be restricted by implementing disk quotas which alert a system administrator before a user consumes too much disk space or a partition becomes full. Disk quotas can be configured for individual users as well as user groups. This makes it possible to manage the space allocated for user-specific files (such as email) separately from the space allocated to the projects a user works on (assuming the projects are given their own groups).

In addition, quotas can be set not just to control the number of disk blocks consumed but to control the number of inodes (data structures that contain information about files in UNIX file systems). Because inodes are used to contain file-related information, this allows control over the number of files that can be created.





* Features of quotas

1). Limits disk usage (blocks or inodes)
2). Tied to file systems (et on a per file system basis)
3). can be configured for users and groups

* Steps to enable quota support :-

1) Enable quota support per file system in : /etc/fstab

a) defaults,usrquota,grpquota

Example:

#vi /etc/fstab

Add following line:

/dev/Volgroup00/logVol02/home ext3 defaults,usrquota,grpquota 1 2

2) Remount the file system(s)




a) mount -o remount /

b) use 'mount' to confirm that 'usrquota, grpquota' support are enabled

Example:

#mount -o remount /home

3) Create quota database files and generate disk usage table

a) quotacheck -mcug /       (where c-create, u-user, g- group)
This creates /aquota.user and aquota.group

b) quotacheck -mavu





4) Assign quota policies: a) edquota username (set blocks/inodes, soft_limits, hard_limits)

Example:

edquota student1 (sets quotas for user student1)

b) edquota -g devl
(for group quota, check using #quota -g devl)

5) Check quotas
#quota username
Example:
#quota student1

6) Report on usage

#repquota -a

==> The blocks are measured in 1K increments, eg 20000 blocks is roughly 20 MB.

* To change the grace period of quota

#edquota -t

* Managing quotas





If quotas are implemented, they need some maintenance-mostly in the form of watching to see if the quotas are exceeded and making sure the quotas are accurate.

a) Enabling and disabling quotas

i) To turn all user and group quotas off

#quotaoff -vuag

If neither the -u and -g options are specified, only the user quotas are disabled. If only -g is specified, only group quotas are disabled. The -v switches causes verbose status informtion to display as the command executes.
ii) To enable quotas again:

#quotaon -vaug




To enable quotas for a specific file system, such as /home, use the following
#quotaon -vug /home
If neither the -u or -g options are specified, only the user quotas are enabled. If only -g is specified, only group quotas are enabled.

b) Reporting on Disk Quotas

#repquota -a

c) Keeping Quotas accurate Whenever a file system is not unmounted clearly (due to a system crash, for eg), it is necessary to run quotacheck. Running the following command periodically keeps the quotas more accurate.

#quotacheck -avug

The easiest way to run it periodically is to use cron.





***************************************************
***************************************************
Read On

How to break root password

0 comments


How to break root password !!!




Method 1:
One of the advantages of single-user mode is that you do not need a boot CD-ROM; however, it does not give you the option to mount the file systems as read-only or not mount them at all. 
If your system boots, but does not allow you to log in when it has completed booting, try single-user mode.
In single-user mode, your computer boots to runlevel 1. Your local file systems are mounted, but your network is not activated. You have a usable system maintenance shell. Unlike rescue mode, single-user mode automatically tries to mount your file system.  
Do not use single-user mode if your file system cannot be mounted successfully. You cannot use single-user mode if the runlevel 1 configuration on your system is corrupted.




1) When you reach the grub screen press 'e' on linux.
2) Go to line which contains the word 'kernel' press 'e'
3) go to the end of that line and write 'linux single' or '1'
4) then press 'esc' twice and press 'b' to reboot the system
5) now wait for the prompt and then type 'passwd root'
6) enter new passwd





Method 2:
In emergency mode, you are booted into the most minimal environment possible. The root file system is mounted read-only and almost nothing is set up. The main advantage of emergency mode over single-user mode is that the init files are not loaded. If init is corrupted or not working, you can still mount file systems to recover data that could be lost during a re-installation.

1) Boot the computer with linux installation CD
2) Enter the linux rescue mode by entering the following command in boot screen
boot:linux rescue
3) When the sh prompt is reached, enter the following commands to change root password:
#chroot /mnt/sysimage
#passwd
The above step will prompt you to enter your new password






******************************************************
******************************************************
Read On

Learn how to install WEBMIN

0 comments


WEBMIN

Webmin is a web-based interface for system administration for Unix. Using any modern web browser, you can setup user accounts, Apache, DNS, file sharing and much more. Webmin removes the need to manually edit Unix configuration files like /etc/passwd, and lets you manage a system from the console or remotely.




Install Webmin (Successfully tested/configured on Ubuntu server 10.04)

#sudo aptitude safe-upgrade
#sudo aptitude update
#sudo mkdir downloads
#cd downloads
#sudo wget http://downloads.sourceforge.net/project/webadmin/webmin/1.510/webmin_1.510-2_all.deb?use_mirror=cdnetworks-us-1
or
#sudo wget http://downloads.sourceforge.net/project/webadmin/webmin/1.510/webmin_1.510-2_all.deb?use_mirror=kent
#sudo dpkg -i webmin_1.510-2_all.deb
#sudo aptitude -f install




=>>You can access the Ubuntu machine from a Windows machine via a web browser by typing the address
https://yourip:10000
or
https://core:10000 , here core is the name of my Ubuntu server.





******************************************************** 
********************************************************
Read On
Related Posts with Thumbnails