<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>egloo &#187; Shells</title>
	<atom:link href="http://egloo.wordpress.com/tag/shells/feed/" rel="self" type="application/rss+xml" />
	<link>http://egloo.wordpress.com</link>
	<description>Linux Sysadmin Blog</description>
	<lastBuildDate>Sat, 18 Apr 2009 19:35:52 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='egloo.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/4f738d3a8dae6c0af9ecb7fb5c48f4a5?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>egloo &#187; Shells</title>
		<link>http://egloo.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://egloo.wordpress.com/osd.xml" title="egloo" />
		<item>
		<title>Turn off echo in a terminal</title>
		<link>http://egloo.wordpress.com/2008/10/13/turn-off-echo-in-a-terminal/</link>
		<comments>http://egloo.wordpress.com/2008/10/13/turn-off-echo-in-a-terminal/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 20:21:52 +0000</pubDate>
		<dc:creator>pcabrerat</dc:creator>
				<category><![CDATA[Shells]]></category>

		<guid isPermaLink="false">http://egloo.wordpress.com/?p=168</guid>
		<description><![CDATA[Imagine you are writing a shell script that requires the user to input confidential information, lets say a password.
The user wont feel comfortable if the password is echoed on the screen like a simple text. If you ever used expect interactive scripting, you know for sure this kind of problem.
Don&#8217;t worry, its amazingly easy to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=egloo.wordpress.com&blog=4102430&post=168&subd=egloo&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><img class="alignleft size-full wp-image-169" title="speaker" src="http://egloo.files.wordpress.com/2008/10/120px-speaker_iconsvg.png?w=120&#038;h=120" alt="" width="120" height="120" />Imagine you are writing a shell script that requires the user to input confidential information, lets say a password.</p>
<p>The user wont feel comfortable if the password is echoed on the screen like a simple text. If you ever used <a href="http://expect.nist.gov/">expect</a> interactive scripting, you know for sure this kind of problem.</p>
<p>Don&#8217;t worry, its amazingly easy to perform this trick and stop echoing whatever the user types on the screen.</p>
<p>Simply add the following line to your script:</p>
<p><code>stty -echo</code></p>
<p>and you are done. The <em>stty </em>output will go offline. Let&#8217;s see an example:</p>
<p><code>#!/bin/bash<br />
echo Hello</code><code><br />
stty -echo<br />
# do what ever you want to do<br />
echo 'I slept with your girlfriend'<br />
stty echo<br />
echo Bye<br />
exit 0;</code></p>
<p>That&#8217;s it! Just remember to put it back to normal with the following command:</p>
<p><code>stty echo</code></p>
<p>Also, it would be helpful for you to read the whole man page for <strong>stty</strong>.</p>
<p><code>$ man stty</code></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/egloo.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/egloo.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/egloo.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/egloo.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/egloo.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/egloo.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/egloo.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/egloo.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/egloo.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/egloo.wordpress.com/168/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=egloo.wordpress.com&blog=4102430&post=168&subd=egloo&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://egloo.wordpress.com/2008/10/13/turn-off-echo-in-a-terminal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">pcabrerat</media:title>
		</media:content>

		<media:content url="http://egloo.files.wordpress.com/2008/10/120px-speaker_iconsvg.png" medium="image">
			<media:title type="html">speaker</media:title>
		</media:content>
	</item>
		<item>
		<title>Linux Restricted Shell</title>
		<link>http://egloo.wordpress.com/2008/08/17/linux-restricted-shell/</link>
		<comments>http://egloo.wordpress.com/2008/08/17/linux-restricted-shell/#comments</comments>
		<pubDate>Sun, 17 Aug 2008 16:41:54 +0000</pubDate>
		<dc:creator>pcabrerat</dc:creator>
				<category><![CDATA[Shells]]></category>

		<guid isPermaLink="false">http://egloo.wordpress.com/?p=100</guid>
		<description><![CDATA[This is typical situation, you created users that were intended to stay in their /home environment, however they seem to have a knack of poking around all your server directories.
A restricted shell is a Unix shell that has been modified to allow the Unix shell user to do fewer things than a normal shell would [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=egloo.wordpress.com&blog=4102430&post=100&subd=egloo&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><img class="alignleft size-full wp-image-101" src="http://egloo.files.wordpress.com/2008/08/linuxsec.jpg?w=124&#038;h=117" alt="" width="124" height="117" />This is typical situation, you created users that were intended to stay in their <code>/home</code> environment, however they seem to have a knack of poking around all your server directories.</p>
<p>A <strong>restricted shell</strong> is a Unix shell that has been modified to allow the Unix shell user to do fewer things than a normal shell would allow him to do. Restricted shells allow you to control the user&#8217;s environment allowing only specific admin-aproved commands.</p>
<p>rssh behaves identically to bash with the exception that at least one of the following commands are allowed:</p>
<p><strong>scp</strong> &#8211; secure copy<br />
<strong>sftp</strong> &#8211; secure FTP<br />
<strong>cvs</strong> &#8211; control versions system<br />
<strong>rsync</strong> &#8211; sync filesystem<br />
<strong>rdist</strong> &#8211; backup utility</p>
<p>Is available through yum in fedora and apt-get in debian. Also you can get a fresh copy from the official website (http://dragontoe.org/rssh/)</p>
<p>In fedora:<br />
<code># yum install rssh</code></p>
<p>In Debian:<br />
<code># apt-get install rssh</code></p>
<p>Now rssh is installed by default it&#8217;s configuration will lock down everything including any sort of access. We need to set up the configuration file. The default file is located at <code>/etc/rssh.conf</code></p>
<p>For example, I only want to allow only <em>scp</em> and <em>sftp</em> to my server. Also I&#8217;m leaving some commented lines for future usage, just in case.</p>
<p><code>allowscp<br />
allowsftp<br />
#allowcvs<br />
#allowrdist<br />
#allowrsync</code></p>
<p>There is no rssh service and the configuration is read on the fly.</p>
<p>Next logical step is to add some users.</p>
<p><code># useradd -m -d /home/sara -s /usr/bin/rssh sara</code></p>
<p>Or if the user already exists, use chmod to assign the restricted shell.</p>
<p><code># usermod -s /usr/bin/rssh sara</code></p>
<p>Now, lets say if <em>sara</em> tries to connect the server with <em>ssh</em> or <code>telnet</code> a message like the following will appear.<br />
<code><br />
This account is restricted by rssh.<br />
Allowed commands: scp sftp</code></p>
<p><code>If you believe this is in error, please contact your system administrator.</code></p>
<p><code>Connection to localhost closed.</code></p>
<p>rssh is a simple way to implement security on your server and rather than a unbreakable security measure, rssh is just the start to forge a secure server. It should be awesome if you could also include a unix jail or a custom restricting script written in your favorite programming language.</p>
<p>Just remember to never underestimate the ingenuity of your users.</p>
<p>Good luck!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/egloo.wordpress.com/100/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/egloo.wordpress.com/100/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/egloo.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/egloo.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/egloo.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/egloo.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/egloo.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/egloo.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/egloo.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/egloo.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/egloo.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/egloo.wordpress.com/100/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=egloo.wordpress.com&blog=4102430&post=100&subd=egloo&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://egloo.wordpress.com/2008/08/17/linux-restricted-shell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">pcabrerat</media:title>
		</media:content>

		<media:content url="http://egloo.files.wordpress.com/2008/08/linuxsec.jpg" medium="image" />
	</item>
	</channel>
</rss>