14 comment

  1. Hi,

    Thanks for this information. Can anybody help me to get the ip address as Linux coding. I normally use the website ip details to get the ip address for windows. But i want to get the ip address for teh linux platform can anybody help me for the coding

  2. Anurdh65,

    To get the ip address of a linux box, type the following from the command prompt (bash shell):


    Sometimes you can also get ip information using the following hack:

    host `hostname`

    To get the ip address of a windows box, type the following form the command promt (dos shell):


  3. To get the just the IP Address under linux, try the following command:
    ifconfig eth1 | grep 'inet'
    This will return both the IPv4 and IPv6 Addresses. If you only want the IPv4 Address, try the following:
    ifconfig eth1 | grep 'Bcast'
    Change to the appropriate interface if it isn’t eth1.

  4. alternative, you can edit /etc/passwd.
    Before :

    After :

  5. You can disable the account by locking it with:
    passwd -l {username}
    What it does is place a ‘!’ in front of the encrypted password in /etc/shadow.

  6. I wanted to have an account that could only FTP and not have any shell access.
    I used the above mentioned ‘chsh -s /sbin/nologin’ but then it would not allow login to FTP either.
    I have restored with ‘chsh -s /bin/bash username’.

    Any idea on how to allow an account FTP access but no shell access?

  7. Folks help please
    I am a new sys admin and when I arrived at org someone had already installed and configured centos 5 linux server. I wanted to allow only to users acess to internet. so I found out that 5 users are on dhcp and they connect to internet..yet even when i put the rest on dhcp, they still cant access internet. The rest are on static ip and even if you add the gateway they wont get internet. please help me as to how I can give some access to internet or deny. the former guy never left documentation. hey, tell me also what i need to do becuase now I dont know how to block or allow access

    Still, have a question? Get help on our forum!