Registrer and earn money just click

Register here, view advertisements and make real money.This site is best for online business you can earn money just by viewing ads and only 10 minutes per day. If you are looking for additional income this site is for you. In time, these additional benefits may exceed your basic income double or even triple.

Monday, December 20, 2010

Howto: restart Linux network service

RedHat Linux command to reload or restart network (login as root user):

# service network restart
OR
# /etc/init.d/network restart

To start Linux network service:
# service network start

To stop Linux network service:
# service network stop

Debian Linux command to reload or restart network:
# /etc/init.d/networking restart

To start Linux network service:
# /etc/init.d/networking start

To stop Linux network service:
# /etc/init.d/networking stop

Ubuntu Linux user use sudo command with above Debian Linux command:
# sudo /etc/init.d/networking restart

To start Linux network service:
# sudo /etc/init.d/networking start

To stop Linux network service:
# sudo /etc/init.d/networking stop

Ubuntu Linux convert DHCP network configuration to static IP configuration

How to change or convert DHCP network configuration to static configuration. After initial installation, he wanted to change network settings. Further, his system is w/o GUI system aka X Windows. Here is quick way to accomplish the same:

Your main network configuration file is /etc/network/interfaces

Desired new sample settings:
=> Host IP address 192.168.1.100
=> Netmask: 255.255.255.0
=> Network ID: 192.168.1.0
=> Broadcast IP: 192.168.1.255
=> Gateway/Router IP: 192.168.1.254
=> DNS Server: 192.168.1.254

Open network configuration file
$ sudo vi /etc/network/interfacesOR$ sudo nano /etc/network/interfaces

Find and remove dhcp entry:
iface eth0 inet dhcp

Append new network settings:

iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.254

Save and close the file. Restart the network:
$ sudo /etc/init.d/networking restart
Task: Define new DNS servers

Open /etc/resolv.conf file
$ sudo vi /etc/resolv.conf

You need to remove old DNS server assigned by DHCP server:
search myisp.com
nameserver 192.168.1.254
nameserver 202.54.1.20
nameserver 202.54.1.30

Save and close the file.
Task: Test DNS server

$ host cyberciti.biz
Network command line cheat sheet

You can also use commands to change settings. Please note that these settings are temporary and not the permanent. Use above method to make network changes permanent or GUI tool as described below.
Task: Display network interface information

$ ifconfig
Task: Take down network interface eth0 / take a network interface down

$ sudo ifconfig eth0 downOR $ sudo ifdown eth0
Task: Bring a network interface eth0 up

$ sudo ifconfig eth0 upOR$ sudo ifup eth0
Task: Change IP address and netmask from command line

Activate network interface eth0 with a new IP (192.168.1.50) / netmask:
$ sudo ifconfig eth0 192.168.1.50 netmask 255.255.255.0 up
Task: Display the routing table

$ /sbin/route OR$ /sbin/route -n
Output:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
localnet * 255.255.255.0 U 0 0 0 ra0
172.16.114.0 * 255.255.255.0 U 0 0 0 eth0
172.16.236.0 * 255.255.255.0 U 0 0 0 eth1
default 192.168.1.254 0.0.0.0 UG 0 0 0 ra0

Task: Add a new gateway

$ sudo route add default gw 172.16.236.0
Task: Display current active Internet connections (servers and established connection)

$ netstat -nat
Task: Display open ports

$ sudo netstat -tulpOR$ sudo netstat -tulpn
Task: Display network interfaces stats (RX/TX etc)

$ netstat -i
Task: Display output for active/established connections only

$ netstat -e
$ netstat -te
$ netstat -tue

Where,

* -t : TCP connections
* -u : UDP connections
* -e : Established

Task: Test network connectivity

Send ICMP ECHO_REQUEST to network hosts, routers, servers etc with ping command. This verifies connectivity exists between local host and remote network system:
$ ping router
$ ping 192.168.1.254
$ ping cyberciti.biz

See simple Linux system monitoring with ping command and scripts for more information.
Task: Use GUI (Graphical Configuration) network Tool

If you are new, use GUI configuration tool, type the following command at terminal:
$ network-admin &

Above command is Ubuntu's GUI for configuring network connections tool.
Final tip - Learn how find out more information about commands

A man page is your best friend when you wanted to learn more about particular command or syntax. For example, read detailed information about ifconfig and netstat command:
$ man ifconfig
$ man netstat

Just get a short help with all command options by appending --help option to each command:
$ netstat --help

Find out what command is used for particular task by searching the short descriptions and manual page names for the keyword:
$ man -k 'delete directory'
$ apropos -s 1 remove

Display short descriptions of a command:
$ whatis rm
$ whatis netstat

Linux offers an excellent collection of utilities, which can be use to finding the files and executables, remember you cannot memorize all the commands and files ;)

Sunday, June 6, 2010

Ubuntu Updates

Super-fast and great-looking, Ubuntu is a secure, intuitive operating system that powers desktops, servers, netbooks and laptops. Ubuntu is, and always will be, absolutely free.

"Get Ubuntu Desktop Edition Download"
You can download Ubuntu Desktop Edition online, completely free.

Download link :

http://www.ubuntu.com/desktop/get-ubuntu/download

Thursday, April 1, 2010

how to Join Centos Domain 5.2 to Windows2003 Domain Controller

Network Setting -- Join Centos Domain 5.2

EDIT the DNS Network Configuration
-goto -sytem -administration - network

point the DNS Manually

Hostname : localhost.localdomain

Primary DNS : 192.168.1.... - IP of your Domain Controller

DNS Search hpo.hd ----- Domain DNS


continue-----------------------------------

-goto -sytem -administration - Authentication Configuration

check - enable winbind support

Windbind domain : HPO
security model : ads
winbind ADS Realm : HPO.HD
Winbind Domain Controllers : mars.hpo.hd
Template : /bin/bash

--Options :
Check shadow passwords
check local authorization is sufficient for local users
check home directories on the first login


Then -- go to File system - etc - samba

Edit the smb.conf

[global]
#--authconfig--start-line--

# Generated by authconfig on 2010/04/01 13:14:56
# DO NOT EDIT THIS SECTION (delimited by --start-line--/--end-line--)
# Any modification may be deleted or altered by authconfig in future

workgroup = HPD
password server = earth.HPO.HD
realm = HPO.HD
security = ads
idmap uid = 16777216-33554431
idmap gid = 16777216-33554431
template shell = /bin/bash
winbind use default domain = true ----- this should be add
winbind offline logon = false

Tuesday, February 9, 2010

Changing to OpenOffice.org 3.1 in CentOS

One of the things that I wanted to do since the installation of CentOS is to upgrade the currrently default version of OpenOffice.org, which is 2.3, to the latest available version being OpenOffice.org 3.1. I have done these upgrades before on Dreamlinux and (X)Ubuntu but this would be the first time on an “rpm based” distribution.


-- (remove old file openoffice)
-- yum remove openoffice.org-*
--cd (riht click the extracted file copy with root directory)
-- sudo rpm -i *.rpm
--cd desktop-integration
--ls
--yum install (right click not yet extracted file .tar)
--sudo rpm -i (redhat-centos)
cd ../ root
--sudo rpm -i *.rpm
--restart
--finish


Link to Resa's Blogs..

http://resa.linux-hardcore.com/?p=154

Wednesday, February 3, 2010

Ubuntu : Active Directory authentication in Ubuntu 8.04 and 8.10

This is a second version of this other guide that applied to previous Ubuntu versions.
Since Ubuntu 8.04 (Hardy Heron), and now Ubuntu 8.10 (Intrepid Ibex) it come the Likewise Open package that makes basic Active Directory authentication in Ubuntu a breeze.

Just follow these steps:

  1. sudo apt-get update
  2. sudo apt-get install likewise-open
  3. sudo domainjoin-cli join fqdn.of.your.domain Administrator
  4. sudo update-rc.d likewise-open defaults
  5. sudo /etc/init.d/likewise-open start

and you can now log into your machine using your DOMAIN\user credentials. Remember that the DOMAIN\ part is mandatory and that it represents the short name of your Active Directory domain. You can join the domain using any user with sufficient privileges (there’s no need to use Administrator), and you can even directly join the PC in a particular OU passing the –ou argument to domainjoin-cli. The fourth point maybe won’t be necessary when Ubuntu 8.04 LTS wil be released because it seems to be a bug in the package (it won’t start likewise on reboot, so if you don’t issue this command it would seem that nothing is working after a reboot).

I’ve just started to use this method on a test machine so I’ll leave more opinions on this product in the future.

EDIT: First impressions

After some days of not so extensive usage, I’ve seen a couple of things that it’s worth notice:

  • the likewise-open process seems to “die” from time to time, blocking all your login accesses with a “ERROR” message. Restarting it through init script solves the issue… but it’s something that definitely should not happen
  • It informs you on login if your password is going to expire in X days (as set in your GPO). Very nice indeed.

Notes to the readers: if you’re experiencing installation problem, the best way is to report them to the likewise-open-discuss mailing list. There you can contact directly likewise developers (of Samba fame) and solve your problems or doubts.

EDIT2: it seems that with the final Ubuntu 8.04 update, likewise-open package is now 100% stable, I didn’t have a single failure since last update (one week up, while before it died at least once per day)

EDIT3: as mentioned in the comment, with likewise-open 4.x you can add

winbind use default domain = yes

in /etc/samba/lwiauthd.conf so you d’nt have to specify the DOMAIN\ part every time you log in your box.

Samba Active Directory Integration

Accessing a Samba Share

Another, use for Samba is to integrate into an existing Windows network. Once part of an Active Directory domain, Samba can provide file and print services to AD users.

The simplest way to join an AD domain is to use Likewise-open. For detailed instructions see the section called “Likewise Open”.

Once part of the domain, install the following packages:

sudo apt-get install samba smbfs smbclient

Since the likewise-open and samba packages use separate secrets.tdb files, a symlink will need to be created in /var/lib/samba:

sudo mv /var/lib/samba/secrets.tdb /var/lib/samba/secrets.tdb.orig
sudo ln -s /etc/samba/secrets.tdb /var/lib/samba

Next, edit /etc/samba/smb.conf changing:

   workgroup = EXAMPLE
...
security = ads
realm = EXAMPLE.COM
...
idmap backend = lwopen
idmap uid = 50-9999999999
idmap gid = 50-9999999999

Restart samba for the new settings to take effect:

sudo /etc/init.d/samba restart

You should now be able to access any Samba shares from a Windows client. However, be sure to give the appropriate AD users or groups access to the share directory. See the section called “Securing a Samba File and Print Server” for more details.

Accessing a Windows Share

Now that the Samba server is part of the Active Directory domain you can access any Windows server shares:

  • To mount a Windows file share enter the following in a terminal prompt:

    mount.cifs //fs01.example.com/share mount_point

    It is also possible to access shares on computers not part of an AD domain, but a username and password will need to be provided.

  • To mount the share during boot place an entry in /etc/fstab, for example:

    //192.168.0.5/share /mnt/windows cifs auto,username=steve,password=secret,rw 0        0
  • Another way to copy files from a Windows server is to use the smbclient utility. To list the files in a Windows share:

    smbclient //fs01.example.com/share -k -c "ls"
  • To copy a file from the share, enter:

    smbclient //fs01.example.com/share -k -c "get file.txt"

    This will copy the file.txt into the current directory.

  • And to copy a file to the share:

    smbclient //fs01.example.com/share -k -c "put /etc/hosts hosts"

    This will copy the /etc/hosts to //fs01.example.com/share/hosts.

  • The -c option used above allows you to execute the smbclient command all at once. This is useful for scripting and minor file operations. To enter the smb: \> prompt, a FTP like prompt where you can execute normal file and directory commands, simply execute:

    smbclient //fs01.example.com/share -k
[Note]

Replace all instances of fs01.example.com/share, //192.168.0.5/share, username=steve,password=secret, and file.txt with your server's IP, hostname, share name, file name, and an actual username and password with rights to the share.



Likewise Open - winbind based


Likewise Open simplifies the necessary configuration needed to authenticate a Linux machine to an Active Directory domain. Based on winbind, the likewise-open package takes the pain out of integrating Ubuntu authentication into an existing Windows network.

Installation

There are two ways to use Likewise Open, likewise-open the command line utility and likewise-open-gui. This section focuses on the command line utility.

To install the likewise-open package, open a terminal prompt and enter:

sudo apt-get install likewise-open

With Ubuntu 9.04 Likewise Open 5.0 is available in the Universe repository. However, since upgrading from Likewise Open 4.1 currently requires the system to leave the domain and re-join, a separate package for version five was created.

To install Likewise Open 5.0 enter:

sudo apt-get install likewise-open5
[Warning]

Installing likewise-open5 over an existing likewise-open (4.1) installation will replace it. You will have to rejoin the domain after install.

Joining a Domain

The main executable file of the likewise-open package is /usr/bin/domainjoin-cli, which is used to join your computer to the domain. Before you join a domain you will need to make sure you have:

  • Access to an Active Directory user with appropriate rights to join the domain.

  • The Fully Qualified Domain Name (FQDN) of the domain you want to join. If your AD domain does not match a valid domain such as example.com, it is likely that it has the form of domainname.local.

  • DNS for the domain setup properly. In a production AD environment this should be the case. Proper Microsoft DNS is needed so that client workstations can determine the Active Directory domain is available.

    If you don't have a Windows DNS server on your network, see the section called “Microsoft DNS” for details.

To join a domain, from a terminal prompt enter:

sudo domainjoin-cli join example.com Administrator
[Note]

Replace example.com with your domain name, and Administrator with the appropriate user name.

You will then be prompted for the user's password. If all goes well a SUCCESS message should be printed to the console.

[Note]

After joining the domain, it is necessary to reboot before attempting to authenticate against the domain.

After successfully joining an Ubuntu machine to an Active Directory domain you can authenticate using any valid AD user. To login you will need to enter the user name as 'domain\username'. For example to ssh to a server joined to the domain enter:

ssh 'example\steve'@hostname
[Note]

If configuring a Desktop the user name will need to be prefixed with domain\ in the graphical logon as well.

To make likewise-open use a default domain, you can add the following statement to /etc/samba/lwiauthd.conf:

winbind use default domain = yes

Then restart the likewise-open daemons:

sudo /etc/init.d/likewise-open restart
[Note]

Once configured for a default domain the 'domain\' is no longer required, users can login using only their username.

The domainjoin-cli utility can also be used to leave the domain. From a terminal:

sudo domainjoin-cli leave

Other Utilities

The likewise-open package comes with a few other utilities that may be useful for gathering information about the Active Directory environment. These utilities are used to join the machine to the domain, and are the same as those available in the samba-common and winbind packages:

  • lwinet: Returns information about the network and the domain.

  • lwimsg: Allows interaction with the likewise-winbindd daemon.

  • lwiinfo: Displays information about various parts of the Domain.

Please refer to each utility's man page specific for details.

Troubleshooting

  • If the client has trouble joining the domain, double check that the Microsoft DNS is listed first in /etc/resolv.conf. For example:

    nameserver 192.168.0.1
  • For more information when joining a domain, use the --loglevel verbose or --advanced option of the domainjoin-cli utility:

    sudo domainjoin-cli --loglevel verbose join example.com Administrator
  • If an Active Directory user has trouble logging in, check the /var/log/auth.log for details.

  • When joining an Ubuntu Desktop workstation to a domain, you may need to edit /etc/nsswitch.conf if your AD domain uses the .local syntax. In order to join the domain the "mdns4" entry from the hosts option. For example:

    hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4

    Change the above to:

    hosts: files dns [NOTFOUND=return]

    Then restart networking by entering:

    sudo /etc/init.d/networking restart

    You should now be able to join the Active Directory domain.

Microsoft DNS

The following are instructions for installing DNS on an Active Directory domain controller running Windows Server 2003, but the instructions should be similar for other versions:

  • Click StartAdministrative ToolsManager Your Server. This will open the Server Role Mangement utility.

    1. Click Add or remove a role

    2. Click Next

    3. Select "DNS Server"

    4. Click Next

    5. Next

    6. Select "Create a forward lookup zone" if it is not selected.

    7. Click Next

    8. Make sure "This server maintains the zone" is selected and click Next.

    9. Enter your domain name and click Next

    10. Click Next to "Allow only secure dynamic updates"

    11. Click Next to "Allow only secure dynamic updates"

    12. Enter the IP for DNS servers to forward queries to, or Select "No, it should not forward queries" and click Next.

    13. Click Finish

    14. Click Finish

    DNS is now installed and can be further configured using the Microsoft Management Console DNS snap-in.

  • Next, configure the Server to use itself for DNS queries:

    1. Click Start

    2. Control Panel

    3. Network Connections

    4. Right Click "Local Area Connection"

    5. Click Properties

    6. Double click "Internet Protocol (TCP/IP)"

    7. Enter the Server's IP Address as the "Preferred DNS server"

    8. Click Ok

    9. Click Ok again to save the settings