<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>1000umbrellas.com &#187; command line</title>
	<atom:link href="http://1000umbrellas.com/tag/command-line/feed" rel="self" type="application/rss+xml" />
	<link>http://1000umbrellas.com</link>
	<description>Michael Descy&#039;s Personal Website</description>
	<lastBuildDate>Fri, 15 Jul 2011 02:06:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<atom:link rel='hub' href='http://1000umbrellas.com/?pushpress=hub'/>
		<item>
		<title>How to Redirect Output from Command-line Processes</title>
		<link>http://1000umbrellas.com/2010/06/24/how-to-redirect-output-from-command-line-processes</link>
		<comments>http://1000umbrellas.com/2010/06/24/how-to-redirect-output-from-command-line-processes#comments</comments>
		<pubDate>Thu, 24 Jun 2010 20:39:33 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[/dev/null]]></category>
		<category><![CDATA[2>&1]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[emails from cron]]></category>
		<category><![CDATA[output]]></category>
		<category><![CDATA[redirect]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[stdin]]></category>
		<category><![CDATA[stdout]]></category>

		<guid isPermaLink="false">http://1000umbrellas.com/?p=884</guid>
		<description><![CDATA[This is definitely a newb-level topic, but I think it is important to understand how to redirect output from your command-line processes. This becomes important because regularly-schedule processes run via cron will email you whatever the output is. This is completely confusing when you first encounter it, and the complete solution isn&#8217;t exactly obvious.
StdOut
When you [...]]]></description>
			<content:encoded><![CDATA[<p>This is definitely a newb-level topic, but I think it is important to understand how to redirect output from your command-line processes. This becomes important because regularly-schedule processes run via cron will email you whatever the output is. This is completely confusing when you first encounter it, and the complete solution isn&#8217;t exactly obvious.</p>
<h2>StdOut</h2>
<p>When you run a process on the command line, it will probably output right back to the terminal. This is StdOut, or &#8220;standard output.&#8221; In scripts and cron jobs, however, you might want to redirect output to a file instead, so you can review the output later.</p>
<p>You can redirect output to a new file by using the &#8220;&gt;&#8221; operator.</p>
<p><code>$ ls -l &gt; ~/directory_listing.txt</code></p>
<p>You can redirect output and <em>append</em> it to a file by using the &#8220;&gt;&gt;&#8221; operator. This method will create a file if it does not already exist.</p>
<h2>StdErr</h2>
<p>Error messages are output to StdErr, which by default is redirected to StdOut. This is why you see normal messages and error messages in the terminal when you run a command. StdErr does not have to be redirected to StdOut, however, and has to be treated separately from StdOut if you are redirecting StdOut.</p>
<h2>/dev/null and 2&gt;&amp;1</h2>
<p>Redirecting output to /del/null sends it nowhere, which effectively gets rid of it. You often see output redirected to /dev/null, followed by a cryptic construction <code>2&gt;&amp;1</code>. Here is what <a href="http://docstore.mik.ua/orelly/unix/upt/ch08_13.htm" target="_blank">that construction means</a>:</p>
<p>In the command<br />
<code>$ tvnamer --batch &gt; ~/log/tvnamer.log 2&gt;&amp;1</code></p>
<ul>
<li>2 refers to StdErr; and</li>
<li><code>&amp;1</code> refers to the first redirection argument; in this case, /log/tvnamer.log.</li>
</ul>
<p>My example uses a normal file, instead of /dev/null, to show that you can use  <code>2&gt;&amp;1</code> with any old file.</p>
<p>This construction is very useful if you find that your cron jobs are sending you emails, even after you redirected their output to log files. Cron will automatically email the owner of the cron job any output (on StdOut) from them. This is why you sometimes are notified that you have emails when you log into your system. Effective redirection will eliminate these emails.</p>
]]></content:encoded>
			<wfw:commentRss>http://1000umbrellas.com/2010/06/24/how-to-redirect-output-from-command-line-processes/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Configure the Firewall with Firehol on Ubuntu 10.04 Lucid Lynx</title>
		<link>http://1000umbrellas.com/2010/05/14/how-to-configure-the-firewall-with-firehol-on-ubuntu-10-04-lucid-lynx</link>
		<comments>http://1000umbrellas.com/2010/05/14/how-to-configure-the-firewall-with-firehol-on-ubuntu-10-04-lucid-lynx#comments</comments>
		<pubDate>Sat, 15 May 2010 00:34:00 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[configure]]></category>
		<category><![CDATA[firehol]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[lucid lynx]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[openssh]]></category>
		<category><![CDATA[samba]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[services]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[Transmission]]></category>
		<category><![CDATA[transmission-daemon]]></category>
		<category><![CDATA[ufw]]></category>
		<category><![CDATA[webmin]]></category>

		<guid isPermaLink="false">http://1000umbrellas.com/?p=862</guid>
		<description><![CDATA[The most popular post on my blog is how to set up the Ubuntu Server firewall via ufw, the Uncomplicated Firewall. I recommend UFW for any standard server, but you might want to move to something more advanced to expand your firewall knowledge, to set up a network gateway, router, or firewall, or to conform [...]]]></description>
			<content:encoded><![CDATA[<p>The most popular post on my blog is <a href="http://1000umbrellas.com/2010/04/29/how-to-set-up-the-firewall-using-ufw-on-ubuntu-lucid-lynx-server">how to set up the Ubuntu Server firewall via ufw</a>, the Uncomplicated Firewall. I recommend UFW for any standard server, but you might want to move to something more advanced to expand your firewall knowledge, to set up a network gateway, router, or firewall, or to conform with other systems on  your network. If UFW is for beginners, then <a href="http://firehol.sourceforge.net/" target="_blank">Firehol</a> is for intermediate sysadmins, or those wishing to run proxy servers and the like.</p>
<p>Before I started using ufw, I used to use Firehol to set up the iptables firewall. Firewall does the same thing that UFW does, and a lot more, but in a completely different way. That’s because Firehol is not just a script, but a language, for defining firewalls. You write your rules in a configuration file, and Firehol will convert them into iptables commands, and issue them at boot time or on demand. It can only create “drop/reject everything, allow explicitly” type firewalls, but luckily, that’s the most appropriate type of firewall to create most of the time.</p>
<p>Firehol is useful not only for standard file and web servers, but also for routers and gateways, and can set up rules for transparent proxies, NAT, and so on. Home users such as myself have a hardware router for that, and only need to set up firewalls on home servers as a defense-in-depth measure.</p>
<p>I think that Firehol is more flexible than ufw, can implement more advanced features such as transparent proxies better than ufw, but it is a little to a lot harder to set up. This tutorial covers how you would lock down a simple home server that you wish to access via the Internet, but not leave completely open to the outside world.</p>
<h2>Installation</h2>
<p>Install the firehol package.</p>
<p><code>$ sudo apt-get install firehol</code></p>
<h2>Enabling Firehol to Start on Boot</h2>
<p>Firehol must be enabled before the rules you define will go into effect. To enable it, you must edit a configuration file.</p>
<p><code>$ sudo nano /etc/default/firehol</code></p>
<p>The file will look like this after a clean install:</p>
<pre>#To enable firehol at startup set START_FIREHOL=YES
START_FIREHOL=NO
#If you want to have firehol wait for an iface to be up add it here
WAIT_FOR_IFACE=""</pre>
<p>Simply change the second line to</p>
<pre>START_FIREHOL=YES</pre>
<p>and save the file. That will enable the firewall upon reboot. What that means is that Firehol will run its bash scripts, generate iptables rules, and then the iptables will be activated. Firehol does not run continuously as a service.</p>
<p>If you wish to disable the firewall, be sure to edit this file again, and reset the START_FIREHOL variable to NO.</p>
<h2>Configuring the Firewall Rules</h2>
<p>The configuration file containing the firewall rules is located in <code>/etc/firehol.conf</code>. This is what the default configuration file looks like. It will set your server to block everything coming in, and accept everything going out.</p>
<pre class="scroll">#
# $Id: client-all.conf,v 1.2 2002/12/31 15:44:34 ktsaou Exp $
#
# This configuration file will allow all requests originating from the
# local machine to be send through all network interfaces.
#
# No requests are allowed to come from the network. The host will be
# completely stealthed! It will not respond to anything, and it will
# not be pingable, although it will be able to originate anything
# (even pings to other hosts).
#

version 5

# Accept all client traffic on any interface
interface any world
client all accept</pre>
<p>You could edit this file and specify your own services, or you could auto-generate a configuration file. I will walk you through auto-generating a confguration file in the next section.</p>
<p>Bear in mind, though, that a fully-working firewall can be made with a configuration file as simple as this:</p>
<p><code>#!/sbin/firehol<br />
version 5<br />
interface any world<br />
protection strong<br />
server "ssh http samba webmin" allow<br />
client all accept<br />
</code></p>
<p>If you are only running standard services, it&#8217;s best to edit the file manually. If you have custom services, or are curious about Firehol&#8217;s abilities, read on.</p>
<h2>Auto-generating a Configuration File</h2>
<p>Firehol can automatically generate a configuration file for you to get you started. The <code>firehol helpme</code> command identifies aany running services on your server and builds a configuration file that will allow all traffic between them, and block all traffic outside those parameters. After the file is generated, you are then expected to review and modify it, to ensure the rules are correct, prior to activating the firewall.</p>
<p>First, use the <code>firehol helpme</code> command to generate a configuration file and put it into the <code>/tmp</code> folder.</p>
<p><code>$ sudo firehol helpme &gt; /tmp/firehol.conf</code></p>
<p>Then, review the automatically generated configuration file.</p>
<p><code>$ nano /tmp/firehol.conf</code></p>
<p>The automatically generated configuration file is pretty verbose. This is what mine looks like, for a server that runs SSH, Samba, <a href="http://1000umbrellas.com/2010/04/21/transmission-install-on-ubuntu-10-04-server-lucid">Transmission</a>, <a href="http://1000umbrellas.com/blog/wp-admin/post.php?action=edit&amp;post=789" target="_self">Dropbox</a>, and Lighttpd web server (it could be Apache or any other web server, really).</p>
<p>Note that there are two interfaces set up: one for my LAN (10.0.0.0/24) and one for the Internet (i.e, anything outside my router’s subnet). When I reviewed it, I notice that the peer ports for my transmission-daemon service are not all mapped, just the one currently in use. Therefore, you definitely have to tweak this file to suit your needs.</p>
<pre class="scroll">#!/sbin/firehol
# : firehol.sh,v 1.273 2008/07/31 00:46:41 ktsaou Exp $
#
# This config will have the same effect as NO PROTECTION!
# Everything that found to be running, is allowed.
# YOU SHOULD NEVER USE THIS CONFIG AS-IS.
#
# Date: Fri May 14 10:43:37 EDT 2010 on host thor
#
# IMPORTANT:
# The TODOs bellow, are *YOUR* to-dos!
#

# INFO: Processing interface 'eth0'
# INFO: Processing IP 10.0.0.3 of interface 'eth0'
# INFO: Is 10.0.0.3 part of network 10.0.0.0/24? yes

# Interface No 1.
# The purpose of this interface is to control the traffic
# on the eth0 interface with IP 10.0.0.3 (net: "10.0.0.0/24").
# TODO: Change "interface1" to something with meaning to you.
# TODO: Check the optional rule parameters (src/dst).
# TODO: Remove 'dst 10.0.0.3' if this is dynamically assigned.
interface eth0 interface1 src "10.0.0.0/24" dst 10.0.0.3

# The default policy is DROP. You can be more polite with REJECT.
# Prefer to be polite on your own clients to prevent timeouts.
policy drop

# If you don't trust the clients behind eth0 (net "10.0.0.0/24"),
# add something like this.
# &gt; protection strong

# Here are the services listening on eth0.
# TODO: Normally, you will have to remove those not needed.
client dhcp accept
server http accept
server ICMP accept
server ms_ds accept
server ntp accept
server samba accept
server ssh accept
server webmin accept

# The following eth0 services are not known by FireHOL:
# tcp/17500 tcp/20550 tcp/9091 udp/10000 udp/17500 udp/20550

# Custom service definitions for the above unknown services.
server custom if1_tcp_17500 tcp/17500 any accept
server custom if1_tcp_20550 tcp/20550 any accept
server custom if1_tcp_9091 tcp/9091 any accept
server custom if1_udp_10000 udp/10000 any accept
server custom if1_udp_17500 udp/17500 any accept
server custom if1_udp_20550 udp/20550 any accept

# The following means that this machine can REQUEST anything via eth0.
# TODO: On production servers, avoid this and allow only the
#       client services you really need.
client all accept

# INFO: Is 10.0.0.1  part of network 10.0.0.0/24? yes
# INFO: Default gateway 10.0.0.1  is part of network 10.0.0.0/24

# Interface No 2.
# The purpose of this interface is to control the traffic
# from/to unknown networks behind the default gateway 10.0.0.1 .
# TODO: Change "interface2" to something with meaning to you.
# TODO: Check the optional rule parameters (src/dst).
# TODO: Remove 'dst 10.0.0.3' if this is dynamically assigned.
interface eth0 interface2 src not "${UNROUTABLE_IPS} 10.0.0.0/24" dst 10.0.0.3

# The default policy is DROP. You can be more polite with REJECT.
# Prefer to be polite on your own clients to prevent timeouts.
policy drop

# If you don't trust the clients behind eth0 (net not "${UNROUTABLE_IPS} 10.0.0.0/24"),
# add something like this.
# &gt; protection strong

# Here are the services listening on eth0.
# TODO: Normally, you will have to remove those not needed.
client dhcp accept
server http accept
server ICMP accept
server ms_ds accept
server ntp accept
server samba accept
server ssh accept
server webmin accept

# The following eth0 services are not known by FireHOL:
# tcp/17500 tcp/20550 tcp/9091 udp/10000 udp/17500 udp/20550

# Custom service definitions for the above unknown services.
server custom if2_tcp_17500 tcp/17500 any accept
server custom if2_tcp_20550 tcp/20550 any accept
server custom if2_tcp_9091 tcp/9091 any accept
server custom if2_udp_10000 udp/10000 any accept
server custom if2_udp_17500 udp/17500 any accept
server custom if2_udp_20550 udp/20550 any accept

# The following means that this machine can REQUEST anything via eth0.
# TODO: On production servers, avoid this and allow only the
#       client services you really need.
client all accept

# INFO: Processing interface 'wlan0'

# IMPORTANT:
# Ignoring interface 'wlan0' because does not have an IP or route.

# The above 2 interfaces were found active at this moment.
# Add more interfaces that can potentially be activated in the future.
# FireHOL will not complain if you setup a firewall on an interface that is
# not active when you activate the firewall.
# If you don't setup an interface, FireHOL will drop all traffic from or to
# this interface, if and when it becomes available.
# Also, if an interface name dynamically changes (i.e. ppp0 may become ppp1)
# you can use the plus (+) character to match all of them (i.e. ppp+).

# No router statements have been produced, because your server
# is not configured for forwarding traffic.</pre>
<h2>Customizing the Configuration File</h2>
<p>The auto-generated configuration file lists “TODO” items for you to do as you review the file. You can rename the interfaces to something meaningful, such as “lan” and “internet”. You can remove any of the named or unnamed (“custom”) services that it includes rules for. A few more of the rules that Firehol generated for my server bear some explanation:</p>
<ul>
<li><a href="http://forums.dropbox.com/topic.php?id=16253" target="_blank">UDP/17500 is used by the Dropbox service</a> to identify other Dropbox clients on the LAN. This rule cannot be removed</li>
<li>TCP and UDP/25500 is one of the peer ports I set up for transmission-daemon. This I actually have to change, because I have a port range open for those services.</li>
<li>UDP/10000 can be removed, because webmin runs on TCP/10000.</li>
</ul>
<h3>Server vs. Client Rules</h3>
<p>Firehol considers all incoming requests &#8220;server&#8221; requests and all outgoing requests &#8220;client&#8221; requests. You might see client accept all in a configuration file. That means that client requests from any service are allowed. If you only want to allow certain services to be allowed, you can specify them much like server services are specified.</p>
<pre>client http allow</pre>
<h3>Setting up Custom Services</h3>
<p>To clean up custom services—for Transmission or Dropbox in this case—you can either give them names and define them inline&#8230;</p>
<pre>server custom transmission-daemon tcp/9091 any accept
server custom dropbox-lan-peers udp/17500 any accept
server custom transmission-peers “tcp/20550:20599 udp/20550:20599” any accept</pre>
<p>&#8230;or define them at the top of the script as variables&#8230;</p>
<pre># Transmission front-end
server_txf_ports="tcp/9091"
client_txf_ports="default"

# Transmission peers
server_txp_ports="tcp/20500:20599 udp/20500:20599"
client_txp_ports="default"

# Dropbox-related LAN functions
server_dpbx_ports="udp/17500"
client_dpbx_ports="default"</pre>
<p>&#8230;and then invoke them very simply:</p>
<pre># custom services
server txf accept
server txp accept
server dpbx accept</pre>
<p>To specify a port range, use a colon instead of a dash to indicate &#8220;through.&#8221; To specify both tcp and udf ports, use a space-delimited list, enclosed in quotation marks.</p>
<h3>Different Rules for LAN vs. Internet</h3>
<p>If you run Samba for file sharing, you&#8217;ll want to allow your LAN users to use Samba file shares, and block Internet users from doing so. (It&#8217;s true that the Samba ports should also be blocked on your router/gateway, if you have one, but bear with me.) To do so, you&#8217;ll want to include rules to allow Samba on your LAN interface (interface1 in the automatically-generated file above), and not include those Samba-related rules in the Internet interface (interface2, above). You might wish to remove webmin and other services from the Internet-side, too. I do both in my configuration file, which is reproduced below.</p>
<h2>My Configuration File</h2>
<p>Here is my configuration file. It implements kinder rules for the LAN and stricter rules for the Internet.</p>
<pre class="scroll">#!/sbin/firehol
# -----------------------------------------------
# Set up custom services
# -----------------------------------------------

# Transmission front-end
server_txf_ports="tcp/9091"
client_txf_ports="default"

# Transmission peers
server_txp_ports="tcp/20500:20599 udp/20500:20599"
client_txp_ports="default"

# Dropbox-related LAN functions
server_dpbx_ports="udp/17500"
client_dpbx_ports="default"

# -----------------------------------------------
# Set up interfaces
# -----------------------------------------------

# LAN Interface
# The purpose of this interface is to control the traffic
# on the eth0 interface with IP 10.0.0.3 (net: "10.0.0.0/24").
interface eth0 lan src "10.0.0.0/24" dst 10.0.0.3

	# policies
	policy reject

	# standard services
	server dhcp accept
	server http accept
	server ICMP accept
	server ms_ds accept
	server ntp accept
	server samba accept
	server ssh accept
	server webmin accept

	# custom services
	server txf accept
	server txp accept
	server dpbx accept

	# client section
	client all accept

# Internet Interface
# The purpose of this interface is to control the traffic
# from/to unknown networks behind the default gateway 10.0.0.1.
interface eth0 internet src not "${UNROUTABLE_IPS} 10.0.0.0/24" dst 10.0.0.3

	# policies
	policy drop
	protection strong

	# Here are the services listening on eth0.
	# TODO: Normally, you will have to remove those not needed.
	server http accept
	server ICMP accept
	server ntp accept
	server ssh accept

	# custom services
	server txf accept
	server txp accept

	# client section
	client http accept
	client https accept
	client ICMP accept
	client ntp accept
	client ssh accept
	client txp accept
	client txf accept</pre>
<p>Note that I have cleaned it up considerably and defined custom services at the top of the file. This is not the most condensed configuration file I could make, but it is easy to understand.</p>
<h2>Testing Your Configuration File</h2>
<p>To test the configuration file you have edited, run the <code>firehol test</code> command.</p>
<p><code>$ sudo firehol test /tmp/firehol.conf</code></p>
<p><code><code>This will do a syntax check of your configuration file, then allow you to commit the changes to the firewall by typing "commit" at a prompt. I recommend that you <em>don't</em> type commit if your configuration file is not in the right place. Let's move the tested, working configuration file there first.</p>
<h2>Enabling Your Configuration</h2>
<p>Once you have customized and tested your configuration file, copy it to where it belongs.</p>
<p><code>$ sudo cp /tmp/firehol.conf /etc/firehol/firehol.conf</code></p>
<p>And then initialize the firewall.</p>
<p><code>$ sudo /etc/init.d/firehol start</code></p>
<p>And you're done!</p>
<p></code></code></p>
]]></content:encoded>
			<wfw:commentRss>http://1000umbrellas.com/2010/05/14/how-to-configure-the-firewall-with-firehol-on-ubuntu-10-04-lucid-lynx/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to List Users in a Group on Ubuntu Server</title>
		<link>http://1000umbrellas.com/2010/05/07/how-to-list-users-in-a-group-on-ubuntu-server</link>
		<comments>http://1000umbrellas.com/2010/05/07/how-to-list-users-in-a-group-on-ubuntu-server#comments</comments>
		<pubDate>Fri, 07 May 2010 14:15:34 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[groups]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[lucid lynx]]></category>
		<category><![CDATA[members]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[users]]></category>

		<guid isPermaLink="false">http://1000umbrellas.com/?p=830</guid>
		<description><![CDATA[It isn&#8217;t obvious at first how to list all the members of a group from a Linux command line (I&#8217;m using Ubuntu Server 10.04 Lucid Lynx).
Listing A User&#8217;s Groups
It is very easy to list the groups that a user belongs to. Simply use the groups command.
$ groups user
This command will output the user name and [...]]]></description>
			<content:encoded><![CDATA[<p>It isn&#8217;t obvious at first how to list all the members of a group from a Linux command line (I&#8217;m using Ubuntu Server 10.04 Lucid Lynx).</p>
<h2>Listing A User&#8217;s Groups</h2>
<p>It is very easy to list the groups that a user belongs to. Simply use the groups command.</p>
<p><code>$ groups user</code></p>
<p>This command will output the user name and a space-delimited list of all the groups that user belongs to, as follows:</p>
<pre>
user : user dialout cdrom floppy audio dip vido plugdev users fuse lp admin sambashare
</pre>
<h2>Listing a Group&#8217;s Members (Users)</h2>
<p>If you want to do the opposite, and list the members of a group, you can use the <code>members</code> command. The catch is: the command is not installed by default. Fortunately, it is simple to install:</p>
<p>$ sudo apt-get install members</p>
<p>Once the package is installed, you can issue the <code>members</code> command similarly to how you issue the <code>groups</code> command.</p>
<p><code>$ members groupname</code></p>
<p>This will output a space-delimited list of all the members of the group, as follows:</p>
<pre>
member1 member2 member3
</pre>
<p>Unlike the groups command, it does not output the name of the group. You may use the optional arguments <code>--primary</code> and <code>--secondary </code>to list only the primary or secondary users within the group. </p>
]]></content:encoded>
			<wfw:commentRss>http://1000umbrellas.com/2010/05/07/how-to-list-users-in-a-group-on-ubuntu-server/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

