{ 14 comments… read them below or add one }

1 daniels June 24, 2009 at 11:52 am

Why not use virtual users for email?


2 anurdh65 June 25, 2009 at 4:24 am


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


3 Vishal June 25, 2009 at 2:08 pm

Can you elaborate your question pls?


4 Rick June 25, 2009 at 5:38 pm


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):



5 Tim (kb0odu) June 26, 2009 at 12:29 am

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.


6 Markus June 27, 2009 at 7:34 am

Setting shell to nologin do not prevent the user to forward ports with SSH.


7 Alfa November 12, 2009 at 2:37 am

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

After :


8 Anonymous December 27, 2009 at 2:20 am

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.


9 KlausRo December 9, 2011 at 12:49 am

Awesome, thanks for this tip!


10 harish April 23, 2011 at 4:42 am

how to enable the ssh account when it is disabled by chsh


11 Jesse July 8, 2011 at 8:06 pm

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?


12 Jesse July 8, 2011 at 8:11 pm
13 ip intel October 7, 2011 at 1:20 pm

n~#usermod -h


14 last January 2, 2012 at 4:33 pm

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


Leave a Comment

Tagged as: , , , , , , , , , , , , , , ,

Previous Faq:

Next Faq: