<?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>Shekhar Govindarajan's Blog &#187; ssh</title>
	<atom:link href="http://www.shekhargovindarajan.com/tag/ssh/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.shekhargovindarajan.com</link>
	<description>My Notepad on the Web</description>
	<lastBuildDate>Tue, 07 Feb 2012 04:58:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com/" />
			<item>
		<title>Solved: Garbled text in Putty</title>
		<link>http://www.shekhargovindarajan.com/tips-n-tricks/solved-garbled-text-in-putty/?&#038;owa_medium=feed&#038;owa_sid=&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=solved-garbled-text-in-putty</link>
		<comments>http://www.shekhargovindarajan.com/tips-n-tricks/solved-garbled-text-in-putty/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 07:19:17 +0000</pubDate>
		<dc:creator>Shekhar</dc:creator>
				<category><![CDATA[Tips N Tricks]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[gallery link=]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Microsoft Windows]]></category>
		<category><![CDATA[ncurses]]></category>
		<category><![CDATA[putty]]></category>
		<category><![CDATA[Secure Shell]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[utf8]]></category>

		<guid isPermaLink="false">http://www.shekhargovindarajan.com/?p=1426</guid>
		<description><![CDATA[Putty is a popular and free Linux terminal/shell client for Windows. It allows one to connect to a Linux server using SSH (Secure Shell) or Telnet. I have been using it for as long as I can recall. But this issue of garbled text in Putty is what I have been ignoring, until yesterday. Yesterday, I had [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/" target="_blank">Putty</a> is a popular and free Linux terminal/shell client for Windows. It allows one to connect to a Linux server using SSH (Secure Shell) or Telnet. I have been using it for as long as I can recall. But this issue of garbled text in Putty is what I have been ignoring, until yesterday.</p>
<p>Yesterday, I had setup <a href="http://en.wikipedia.org/wiki/Paradox_(database)" target="_blank">Paradox</a> database using <a href="http://www.dosemu.org/" target="_blank">DOSEMU</a> on Linux, for a client. On Putty, the Paradox interface showed garbled making it unusable for the client. My instant suspect was DOSEMU. A quick check revealed that it&#8217;s happening with other apps too - those with a <a href="http://en.wikipedia.org/wiki/Ncurses" target="_blank">ncurses</a> or text based user interface.<span id="more-1426"></span>For example: The garbled text, around the borders of UI elements, showed in ntsysv (as shown in the screenshots). ntsysv is a nifty console app, found in RedHat/CentOS/Fedora Linux, to start services during boot up.
<a href='http://www.shekhargovindarajan.com/tips-n-tricks/solved-garbled-text-in-putty/attachment/before-ntsysv-showing-garbled-text-in-putty/' title='Before - ntsysv showing garbled text in Putty'><img width="150" height="150" src="http://www.shekhargovindarajan.com/wp-content/uploads/2010/03/Before-ntsysv-showing-garbled-text-in-Putty-150x150.png" class="attachment-thumbnail" alt="Before - ntsysv showing garbled text in Putty" title="Before - ntsysv showing garbled text in Putty" /></a>
<a href='http://www.shekhargovindarajan.com/tips-n-tricks/solved-garbled-text-in-putty/attachment/putty-settings-to-fix-garbled-text/' title='Putty settings to fix garbled text'><img width="150" height="150" src="http://www.shekhargovindarajan.com/wp-content/uploads/2010/03/Putty-settings-to-fix-garbled-text-150x150.png" class="attachment-thumbnail" alt="Putty settings to fix garbled text" title="Putty settings to fix garbled text" /></a>
<a href='http://www.shekhargovindarajan.com/tips-n-tricks/solved-garbled-text-in-putty/attachment/after-ntsysv-after-the-change-in-settings-in-putty/' title='After - ntsysv after the change in settings in Putty'><img width="150" height="150" src="http://www.shekhargovindarajan.com/wp-content/uploads/2010/03/After-ntsysv-after-the-change-in-settings-in-Putty-150x150.png" class="attachment-thumbnail" alt="After - ntsysv after the change in settings in Putty" title="After - ntsysv after the change in settings in Putty" /></a>
</p>
<p><strong>The Solution<br />
</strong>Launch Putty. On the Category pane (on the left), click on Windows&gt;Translation. For the dropdown labeled &#8220;Received data assumed to be in which character set&#8221;, select UTF-8. To save this setting, click on Sessions (in the Category pane). On the right pane, select &#8220;Default Settings&#8221; and click on the button labeled Save. This is what worked for me with Putty version 0.60.</p>
<img src="http://www.shekhargovindarajan.com/?ak_action=api_record_view&id=1426&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.shekhargovindarajan.com/tips-n-tricks/solved-garbled-text-in-putty/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Secure File Transfer without Secure Shell</title>
		<link>http://www.shekhargovindarajan.com/tips-n-tricks/secure-file-transfer-without-secure-shell/?&#038;owa_medium=feed&#038;owa_sid=&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=secure-file-transfer-without-secure-shell</link>
		<comments>http://www.shekhargovindarajan.com/tips-n-tricks/secure-file-transfer-without-secure-shell/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 12:20:34 +0000</pubDate>
		<dc:creator>Shekhar</dc:creator>
				<category><![CDATA[Tips N Tricks]]></category>
		<category><![CDATA[access]]></category>
		<category><![CDATA[barred]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[denied]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[scp]]></category>
		<category><![CDATA[scponly]]></category>
		<category><![CDATA[Secure Shell]]></category>
		<category><![CDATA[sftp]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[text editor]]></category>

		<guid isPermaLink="false">http://www.shekhargovindarajan.com/?p=625</guid>
		<description><![CDATA[FTP (File Transfer Protocol) is the de-facto but unsecure method to transfer files. SSH (Secure Shell) and its family of services like SCP (Secure Copy) and SFTP (Secure FTP) allows you shell (telnet like) access as well as file transfer via SCP and SFTP, securely. By &#8220;securely&#8221; I mean the data is that flows across [...]]]></description>
			<content:encoded><![CDATA[<p>FTP (File Transfer Protocol) is the de-facto but unsecure method to transfer files. SSH (Secure Shell) and its family of services like SCP (Secure Copy) and SFTP (Secure FTP) allows you shell (telnet like) access as well as file transfer via SCP and SFTP, securely. By &#8220;securely&#8221; I mean the data is that flows across is encrypted including the username and password. SSH is a popular protocol for shell access and file transfer in the Linux world.</p>
<p>So given a choice, SCP/SFTP is a better option in terms of &#8220;security&#8221;. But enabling SFTP/SCP enables, by default, shell access too. Recently for one of my clients, the requirement was to use SCP instead of FTP while blocking shell access so that no user is able to login, in curiosity, nor could execute any program/script on the server, even by mistake. All they could do is to copy files across &#8211; from their desktop to the server and vice versa.  But, I could not find anything in  SSH configuration that barred SSH, while still allowing SCP.<span id="more-625"></span></p>
<p>The solution lied outside SSH and was trivial. It is called <strong>scponly</strong>. scponly is a shell program, just like Bash, Ksh which barrs shell access via SSH. I had <a href="http://www.centos.org/" target="_blank">CentOS</a> 5.2 running on the client&#8217;s server. scponly RPM was not available from the CentOS repositories. I then setup the <a href="https://rpmrepo.org/RPMforge/Using" target="_blank">RPMForge repository</a> as follows:</p>
<p><em> rpm -ivh http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm</em></p>
<p>Note that the above setup is specific to CentOS 5. Subsequently, I installed scponly as:</p>
<p><em>yum install scponly</em></p>
<p>Next, the shell of all the users, who are barred SSH access, must be set to /usr/bin/scponly. For existing users there are two ways to do it:</p>
<p><strong>Method 1: Using usermod (Recommended)<br />
</strong>Login as root and issue the following command:</p>
<p><em>usermod &#8211;shell /usr/bin/scponly &lt;username&gt;</em></p>
<p>Substitue &lt;username&gt; with the name of the user who will be barred shell access</p>
<p><strong>Method 2: Edit /etc/passwd<br />
</strong>Login as root and open the file named passwd, found in /etc directory, in a text editor. The file contains entry for each user on a seperate line along with their shell name. For example:</p>
<p><em>&lt;username&gt;:x:506:508::/home/&lt;username&gt;:/bin/bash</em></p>
<p>Replace /bin/bash with /usr/bin/scponly. Save the file. This will change the shell of the user named &lt;username&gt; to scponly.</p>
<p><strong>For new users<br />
</strong>For new users you can set the shell to scponly while creating the user via useradd command:</p>
<p><em>useradd &#8211;shell /usr/bin/scponly &lt;username&gt;</em></p>
<p>Once done, when one (who is barred the shell access) tries to SSH, he/she will be able to proceed upto the point of the password prompt. At the prompt, even after supplying a correct password, he/she will not be dropped into a shell. In fact it will appear as if the SSH login has hung &#8211; no errors, no access denied messages.</p>
<img src="http://www.shekhargovindarajan.com/?ak_action=api_record_view&id=625&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.shekhargovindarajan.com/tips-n-tricks/secure-file-transfer-without-secure-shell/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

