<?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>Linux Neophyte &#187; SSH</title>
	<atom:link href="http://linuxneophyte.com/tag/ssh/feed/" rel="self" type="application/rss+xml" />
	<link>http://linuxneophyte.com</link>
	<description>Trials of a Linux Newb.</description>
	<lastBuildDate>Mon, 20 Oct 2008 12:42:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SSH Tab Completion in Fedora Core 6</title>
		<link>http://linuxneophyte.com/ssh-tab-completion-in-fedora-core-6/</link>
		<comments>http://linuxneophyte.com/ssh-tab-completion-in-fedora-core-6/#comments</comments>
		<pubDate>Mon, 19 Feb 2007 20:27:36 +0000</pubDate>
		<dc:creator>M@</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[BASH]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Console]]></category>
		<category><![CDATA[FC6]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://linuxneophyte.com/ssh-tab-completion-in-fedora-core-6/</guid>
		<description><![CDATA[I&#8217;ve found that the extended tab-complete functionality in Ubuntu is a major timesaver.  I do a LOT of SSHing from machine to machine in my house as well as to machines out there on the Internet.  I use my ~/.ssh/config file to set up easy-to-remember names for these machines and then use the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve found that the extended tab-complete functionality in Ubuntu is a major timesaver.  I do a LOT of SSHing from machine to machine in my house as well as to machines out there on the Internet.  I use my <code>~/.ssh/config</code> file to set up easy-to-remember names for these machines and then use the command line to connect.  For example, to connect to my Anapnea.net shell account, I have a block in my config file that looks like this:</p>
<blockquote><p> <code>host anapnea<br />
hostname anapnea.net<br />
user fakeusername<br />
identityfile ~/.ssh/id</code></p></blockquote>
<p>When I want to log in, I open my terminal program of choice and enter <code>ssh ana&lt;tab&gt;</code> and press enter.  Pressing tab expands to <code>anapnea</code> and I make my connection saving 4 keystrokes.</p>
<p><strong>Note: </strong>For those interested, SSH tab-complete will expand to the value of <em>host</em> or <em>hostname</em>.  That&#8217;s handy if you can remember the actual hostname of the machine and you&#8217;ve forgotten what you entered as the value of host (yeah, I&#8217;ve done it).  If that makes no sense to you, you can get more information on SSH config files with <code>man 5 ssh_config</code>.</p>
<p>Tab complete also works with <code>lftp</code> and some other programs when using Ubuntu.  I&#8217;ve found the lack of it in Fedora a little frustrating (I keep pressing tab and get nothing).  I did a little Googling to find out just what program sets up this functionality and checked the Fedora repos for it.  Thankfully it can be found in all it&#8217;s glory and awaiting installation in Fedora extras.</p>
<p><code>su -c 'yum install bash-completion'</code></p>
<p>A few seconds later, you&#8217;re ready to bank your keystrokes and tab complete to your heart&#8217;s content.</p>
<p><strong>Note: </strong>Any terminal sessions that were open when you installed the package won&#8217;t utilize it until you either restart the session or enter <code>bash</code> at the prompt.  It seems that your shell needs to source the newly created <code>/etc/profile.d/bash_completion.sh</code> script.  This is done when you invoke BASH by opening a terminal prompt or executing <code>bash</code> at the command line.</p>
]]></content:encoded>
			<wfw:commentRss>http://linuxneophyte.com/ssh-tab-completion-in-fedora-core-6/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Anapnea.net: Free Linux Shell Accounts</title>
		<link>http://linuxneophyte.com/anapneanet-free-linux-shell-accounts/</link>
		<comments>http://linuxneophyte.com/anapneanet-free-linux-shell-accounts/#comments</comments>
		<pubDate>Mon, 22 Jan 2007 17:47:47 +0000</pubDate>
		<dc:creator>M@</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Console]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://linuxneophyte.com/anapneanet-free-linux-shell-accounts/</guid>
		<description><![CDATA[http://anapnea.net is offering free Linux shell accounts to those that would like to apply.  I read about this on Sunday morning (yesterday) via Digg and decided to give it shot.  I joined the IRC channel (#anapnea on FreeNode) and queried cyraq asking about the application.  It was a simple process, he asked [...]]]></description>
			<content:encoded><![CDATA[<p><a target="_blank" href="http://anapnea.net/">http://anapnea.net</a> is offering free Linux <a target="_blank" href="http://en.wikipedia.org/wiki/Shell_account">shell accounts</a> to those that would like to apply.  I read about this on Sunday morning (yesterday) via <a target="_blank" href="http://digg.com/">Digg</a> and decided to give it shot.  I joined the IRC channel (#anapnea on <a target="_blank" href="http://freenode.net/">FreeNode</a>) and queried cyraq asking about the application.  It was a simple process, he asked why I needed the account (explaining that this is a standard application question) and I told him that I&#8217;m new to Linux, and for me, it&#8217;s a learning experience.  After that, I just had to provide him with my desired username. <img src='http://linuxneophyte.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I figure sharing a system with others can teach me a few things, I looked at it from a newb&#8217;s point of view and here are some of the reasons I came up with for checking out Anapnea.</p>
<p><strong>Community:</strong>  The IRC channel is full of people buzzing about the service, asking questions, and giving each other help.  It seems to be a combination of newish to seasoned Linux/Unix users that are excited about the service.  If you&#8217;re just getting started with Linux, this is a great way to get some help.  Everyone using that service is using the exact same software as you.  If you have a question, ask, you&#8217;re almost sure to get an answer.</p>
<p><strong>Introduction to Console Applications:</strong>  You&#8217;ll have access to several well known communication applications.  IRSSI, CenterICQ and others.  These are common Linux tools for communicating on IRC and IM networks.  You can read about some of them on the Anapnea home page.  The apps are already installed for you, all you have to do is try them out.  See what you like or don&#8217;t like.  I would suggest reading up on <a target="_blank" href="http://irssi.org/">IRSSI</a>, if you&#8217;re totally green, it&#8217;s not the easiest application to configure.  That said, it&#8217;s the IRC client I&#8217;ve been using since I first gave Linux a shot.  It&#8217;s terrific!.</p>
<p><strong>Resource Sharing:</strong>  By sharing a system with others, you get a feel for the right and wrong things to do when on a multi-user system.  Poking around in other people&#8217;s home dirs would fall into the &#8220;wrong&#8221; category.  That is a sure way to get your account revoked.  I watched somebody lose his account today because he was doing just that.  You are permitted to protect your directory from peekers, and I would do so (<code>chmod 700 $HOME</code>).</p>
<p><strong>Introduction to SSH:</strong>  SSH (Secure Shell) is the most common way to remotely log into a Linux server.  If you haven&#8217;t yet made the jump to Linux, you might not even  be aware of how useful SSH is (trust me, it&#8217;s amazing).  Why not try it out, you can use an app like PuTTy on your Windows box to log into your account and muck about with Linux applications.</p>
<p><strong>Customizing a BASH Environment:</strong>  OK, this may not be for the super newbie, <a target="_blank" href="http://en.wikipedia.org/wiki/BASH">BASH</a> is the shell you&#8217;ll be using to interact with the computer.  There are <em>[insert some insanely high, random number]</em> of things you can do with BASH.  Again, this comes in really handy if you haven&#8217;t got your own Linux box to play with but want to poke around.  Not to worry if you really are 100% new to Linux, BASH doesn&#8217;t require customization to use it.</p>
<p>An account on Anapnea isn&#8217;t a replacement for your own Linux machine, you will only have 5 MB of storage and access to a limited number of applications.  It is however, a great way to get your feet wet AND have some free web space out there on the Internet.</p>
<p>Another cool note, when asked if you&#8217;re a Gentoo user, you can proudly say Yes!</p>
<p><strong>About Anapnea.net:</strong></p>
<p>This morning, I spent a few minutes talking to cyraq, I wanted to know just why the hell he was offering this service, and maybe find out a little bit about him.  It turns out his reason for starting Anapnea, was to help people who needed a shell account but didn&#8217;t necessarily have the means to buy one.  If you&#8217;re not sure why anyone would need/want a remote shell account, I can offer an example.  I have a friend who&#8217;s university won&#8217;t permit the use of IRC on their network.  Being a student, he doesn&#8217;t have extra money for a shell account.  This is a perfect solution for him, he can use IRC resources without violating the University&#8217;s rules.</p>
<p>The first two weeks of Anapnea&#8217;s life went well.  News spread of its existence through word of mouth, people would sign up (who wouldn&#8217;t?) and a small community began to develop.   Eventually, it was <a target="_blank" href="http://digg.com/linux_unix/Anapnea_Free_linux_shell_account_hosting_on_a_supercomputer">Dugg</a> and In a period of 12 hours, cyraq went from being the sole administrator of 48 accounts, to the leader of a 3 person administration team that now had to manage 370 accounts (one of which I own).  I can&#8217;t tell the story better than he, so&#8230;</p>
<blockquote><p>(16:26) (mattds) and this was pretty much overnight?<br />
(16:26) (cyraq) yeah, woke up at 3AM to get some water, and on the way checked my email<br />
(16:26) (cyraq) You have 126 new emails.<br />
(16:27) (cyraq) stayed up till 3PM<br />
(16:27) (cyraq) went back to sleep at 6PM<br />
(16:27) (cyraq) at one point, the emails were coming faster than i could answer them</p></blockquote>
<p>I don&#8217;t have any info on the newest members of the team (lightdifference and Mike42), but I do know that cyraq is a young admin and by his own admission, very passionate about Linux.  I think it&#8217;s great that he&#8217;s giving back to the community by offering this service.  Another reason to embrace Linux and the people involved with it.</p>
<p><strong>Disclaimer:</strong> I&#8217;m not a reporter, my apologies if that&#8217;s the lamest summary of an interview you&#8217;ve ever read <img src='http://linuxneophyte.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://linuxneophyte.com/anapneanet-free-linux-shell-accounts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>DD-WRT: Password Free Login to LAN Hosts from DD-WRT Shell</title>
		<link>http://linuxneophyte.com/dd-wrt-password-free-login-to-lan-hosts-from-dd-wrt-shell/</link>
		<comments>http://linuxneophyte.com/dd-wrt-password-free-login-to-lan-hosts-from-dd-wrt-shell/#comments</comments>
		<pubDate>Mon, 22 Jan 2007 05:27:11 +0000</pubDate>
		<dc:creator>M@</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Console]]></category>
		<category><![CDATA[DD-WRT]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://linuxneophyte.com/dd-wrt-password-free-login-to-lan-hosts-from-dd-wrt-shell/</guid>
		<description><![CDATA[The Dropbear SSH client included on the DD-WRT firmware can make it trivial for you to access computers on your network without exposing them to the Internet.  For example, let&#8217;s say I have remote SSH management enabled on my router, and I have a computer named ubuntu running an SSHd on my LAN.  [...]]]></description>
			<content:encoded><![CDATA[<p>The Dropbear SSH client included on the DD-WRT firmware can make it trivial for you to access computers on your network without exposing them to the Internet.  For example, let&#8217;s say I have remote SSH management enabled on my router, and I have a computer named <em>ubuntu</em> running an SSHd on my LAN.  I want to log into <em>ubuntu</em> from anywhere but don&#8217;t want to forward ports from the WAN side of the router to that machine.  All I need to do is SSH into my router, and from the DD-WRT shell prompt enter <code>ssh <em>[username]</em>@ubuntu</code> and provide my password.  All very easy to do and keeps my machines away from the world on the ugly side of the router/firewall.</p>
<p>Now, <em>ubuntu</em> is only accessible from the LAN, so to make my life a little easier, I want to allow password-less logins, this is how it&#8217;s done.</p>
<p><em>This builds off of <a target="_blank" href="http://linuxneophyte.com/dd-wrt-ssh-remote-management-with-public-key-authentication/">DD-WRT: SSH Remote Management with Public Key Authentication</a> and <a target="_blank" href="http://linuxneophyte.com/dd-wrt-samba-startup-script-reconfigure-dropbear-sshd/">DD-WRT: Samba Startup Script / Reconfigure Dropbear SSHd</a>.</em>  Just to keep things fresh, the router only allows logins via public-key authentication, the machine <strong>ubuntu</strong> hosts the script that the router launches at startup on a Samba share (<code>smb://ubuntu/ddwrt</code>).  The local path to that share on <strong>ubuntu</strong> is <code>~/ddwrt</code>.  The router will map that share to <code>/tmp/smbshare</code> during startup and will execute the <code>dd-wrt-startup.sh</code> script located there.</p>
<p><strong>Configure public-key authenication on the Linux machine:</strong></p>
<p>Since I used this machine to create a keypair earlier, I&#8217;m just going to recycle.  Up until now, I&#8217;ve only configured this machine to <em>make</em> connections to other hosts using public-key authentication.  Now I need to <em>accept</em> public-key auth connections from other hosts.</p>
<p>To do this, I need to create an <code>authorized_keys</code> file in <code>~/.ssh/</code>.  The command below will write my <code>~/.ssh/id_rsa.pub</code> file to the bottom of a pre-existing <code>authorized_keys</code> file or create a new one if it doesn&#8217;t exist.  This file allows me to authenticate with my private key on the computer <em>ubuntu</em>.</p>
<blockquote><p>cat ~/.ssh/id_rsa.pub >>~/.ssh/authorized_keys</p></blockquote>
<p><strong>Copy private key to router and convert it:</strong></p>
<p>Next, I need to get my private key someplace accessible to the router, I&#8217;m just copying it to the Samba share that auto-mounts when the router starts up.</p>
<blockquote><p>cp -v ~/.ssh/id_rsa ~/ddwrt/</p></blockquote>
<p>Now, I remove the password from the copy of the private key, this <strong>is</strong> mandatory.  DD-WRT&#8217;s Dropbear client has its own format for private keys and cannot convert encrypted (password protected) OpenSSH keys.  Not to mention that I actually WANT password-less logins <img src='http://linuxneophyte.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .  Just follow the prompts provided after executing the next command.</p>
<blockquote><p>ssh-keygen -p -f ~/ddwrt/id_rsa</p></blockquote>
<p><strong>Note:</strong> This key will NEVER leave my personal network so I&#8217;m not worried about it getting into the hands of anyone I don&#8217;t trust.</p>
<p>Next I SSH into the router.</p>
<blockquote><p>ssh root@192.168.1.1 -i ~/.ssh/id_rsa</p></blockquote>
<p>Using <code>dropbearkonvert</code> I convert the OpenSSH key to a Dropbear key.</p>
<blockquote><p>dropbearkonvert openssh dropbear /tmp/smbshare/id_rsa /tmp/smbshare/id_dropbear</p></blockquote>
<p><strong>Install private key to home dir at router startup:</strong></p>
<p>The last step is to have the key installed to the <code>/tmp/root/.ssh/</code> directory on the router whenever the router starts up.  I could opt to leave the key on the Samba mount, but I decided to put it on the router because I actually have more than one machine I want to get to.  If for some reason the machine running the Samba server is off-line, I wouldn&#8217;t have access to the private key.</p>
<p>To automagically install the key, I need to add the lines below to the router&#8217;s startup script, this can be done from the router, <code>vi /tmp/smbshare/dd-wrt-startup.sh</code> or from my desktop using my editor of choice <code>nano ~/ddwrt/dd-wrt-startup.sh</code>.</p>
<blockquote><p>## install dropbear private key for passwordless login to other machines<br />
cp /tmp/smbshare/id_dropbear /tmp/root/.ssh/<br />
chmod 600 /tmp/root/.ssh/id_dropbear</p></blockquote>
<p>You can reboot the router to test the script or you can manually enter <code>cp /tmp/smbshare/id_dropbear /tmp/root/.ssh/</code> on the router and test it by entering <code>ssh <em>[username]@[hostname]</em> -i ~/.ssh/id_dropbear</code>.  This should bring up a prompt similar to the one below:</p>
<blockquote><p>Host &#8216;ubuntu&#8217; is not in the trusted hosts file.<br />
(fingerprint md5 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx)<br />
Do you want to continue connecting? (y/n)</p></blockquote>
<p>Answering &#8220;y&#8221; will add the host to <code>~/.ssh/known_hosts</code> and I won&#8217;t be prompted about it again until I reboot the router.  If I want to permanently add all of my machines to <code>known_hosts</code>, I can connect to each one of them and answer &#8220;<code>y</code>&#8221; at the <code> Do you want to continue connecting?</code> Prompt.  After all of my hosts are known, I copy the file from the router to my Samba share (<code>cp ~/.ssh/known_hosts /tmp/smbshare</code>).  Lastly, I go back to my startup script and add the line below.</p>
<blockquote><p>cp /tmp/smbshare/known_hosts /tmp/root/.ssh/</p></blockquote>
<p>that&#8217;s all folks, the router will install the files I need whenever it reboots and I have access to all of my machines through ONE tightly locked door.</p>
]]></content:encoded>
			<wfw:commentRss>http://linuxneophyte.com/dd-wrt-password-free-login-to-lan-hosts-from-dd-wrt-shell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>DD-WRT: Samba Startup Script / Reconfigure Dropbear SSHd</title>
		<link>http://linuxneophyte.com/dd-wrt-samba-startup-script-reconfigure-dropbear-sshd/</link>
		<comments>http://linuxneophyte.com/dd-wrt-samba-startup-script-reconfigure-dropbear-sshd/#comments</comments>
		<pubDate>Mon, 15 Jan 2007 05:06:48 +0000</pubDate>
		<dc:creator>M@</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Console]]></category>
		<category><![CDATA[DD-WRT]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://linuxneophyte.com/dd-wrt-samba-startup-script-reconfigure-dropbear-sshd/</guid>
		<description><![CDATA[Yep, still working with DD-WRT  ..  I wanted to make some changes to the router config but these changes aren&#8217;t available in DD-WRT&#8217;s control panel.  Since we&#8217;re working with Linux here, I figured there had to be SOME way to hack it up..  Well, I was correct!  The firmware has [...]]]></description>
			<content:encoded><![CDATA[<p>Yep, still working with <a target="_blank" href="http://en.wikipedia.org/wiki/DD-WRT">DD-WRT</a> <img src='http://linuxneophyte.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ..  I wanted to make some changes to the router config but these changes aren&#8217;t available in DD-WRT&#8217;s control panel.  Since we&#8217;re working with Linux here, I figured there had to be SOME way to hack it up..  Well, I was correct!  The firmware has some features that make it pretty simple to execute a script at startup.  You have some options, one is to enable <a target="_blank" href="http://en.wikipedia.org/wiki/JFFS">JFFS</a> and physically store a script on the router.  Another is to mount a <a target="_blank" href="http://en.wikipedia.org/wiki/Samba_software">Samba</a> share on startup and keep your script there.  I opted for the Samba share because it can store your script as well as allow you to upload files (via scp for instance) directly to a computer on your network through your SSHd.</p>
<p>The script I&#8217;m creating is only useful if you have your router configured for remote SSH management (see <a target="_blank" href="http://linuxneophyte.com/dd-wrt-ssh-remote-management-with-public-key-authentication/">DD-WRT: SSH Remote Management with Public Key Authentication</a> for my how-to).  The configuration process applies to setting up any startup script on a Samba share.</p>
<p>The script I want to execute on startup is going to change the configuration of the <a target="_blank" href="http://matt.ucc.asn.au/dropbear/dropbear.html">Dropbear SSHd</a>.  By default, when you connect to the router via SSH, you&#8217;re presented with a pre-login prompt advertising the firmware&#8217;s version.  I prefer not sharing that info with anyone (not in such a blatant fashion at any rate), so I need to kill off the dropbear process and restart it without the banner flag.  You might be wondering why I don&#8217;t just edit dropbear&#8217;s config file on the router&#8230;  The simple answer is that there isn&#8217;t one. <img src='http://linuxneophyte.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I&#8217;m going to be using a Samba share I&#8217;ve created just for DD-WRT on the machine named <strong>ubuntu</strong> (also my desktop).  The local path is <code>~/ddwrt</code> and the network path is <code>smb://ubuntu/ddwrt</code></p>
<p><strong>Create the script:</strong></p>
<p>Create a script on your Samba share named <code>dd-wrt-startup.sh</code>.  One way to create the file is to enter the commands below in a terminal.</p>
<blockquote><p>cd ~/ddwrt<br />
touch dd-wrt-startup.sh</p></blockquote>
<p>Open <code>~/ddwrt/dd-wrt-startup.sh</code> with your editor of choice and add the text below (each command should be on its own line):</p>
<blockquote><p><code>#!/bin/sh<br />
## kill/restart dropbear; remove pre-logon message<br />
killall dropbear<br />
dropbear -r /tmp/root/.ssh/ssh_host_rsa_key -d /tmp/root/.ssh/ssh_host_dss_key -p 22 -s</code></p></blockquote>
<p>Be sure that when you specify the port (<code>-p 22</code>), you use the same port that you have configured in the DD-WRT control panel.</p>
<p>The difference between the command to launch dropbear that I wrote, and the command the router defaults to, is that I&#8217;ve removed the banner file flag (<code>-b [path to loginprompt]</code>).  If you want to see what the exact command line is on your router before you make the change, SSH in and enter a <code>ps</code>, someplace in the process list you&#8217;ll see the dropbear command line.</p>
<p><strong>Configure Samba FS Automount:</strong></p>
<p>Before going on, be sure that the Samba server has a static IP or (better yet) a static DHCP address.  If you don&#8217;t use static DHCP, you may want to use the machine&#8217;s IP address instead of its name when configuring the share below.  Check out the <a target="_blank" href="http://www.dd-wrt.com/wiki/index.php/DNSMasq_as_DHCP_server">DD-WRT DNSMasq wiki page</a> for more info.</p>
<p>Log into the DD-WRT Control Panel, Click <em>Administration</em> then select the <em>Management</em> tab.  Scroll down to the <em>Samba FS Automount</em> section and configure as follows:</p>
<blockquote>
<ul>
<li><strong>SMB Filesystem:</strong> Enable</li>
<li><strong>Share:</strong> //ubuntu/ddwrt</li>
<li><strong>User Name:</strong> [valid smb user]</li>
<li><strong>Password:</strong> [smb user's password]</li>
<li><strong>Startscript:</strong> dd-wrt-startup.sh</li>
</ul>
</blockquote>
<p>Now all you need to do is click <em>Save Settings</em> and <em>Reboot Router</em>.  The next time you SSH in, you&#8217;ll notice that no information about the router is given until you&#8217;ve provided your credentials and successfully authenticated.  You will also notice that entering the <code>mount</code> command will show you that your Samba share is mounted to <code>/tmp/smbshare</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://linuxneophyte.com/dd-wrt-samba-startup-script-reconfigure-dropbear-sshd/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>DD-WRT: SSH Remote Management with Public Key Authentication</title>
		<link>http://linuxneophyte.com/dd-wrt-ssh-remote-management-with-public-key-authentication/</link>
		<comments>http://linuxneophyte.com/dd-wrt-ssh-remote-management-with-public-key-authentication/#comments</comments>
		<pubDate>Fri, 12 Jan 2007 05:03:41 +0000</pubDate>
		<dc:creator>M@</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Console]]></category>
		<category><![CDATA[DD-WRT]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://linuxneophyte.com/dd-wrt-ssh-remote-management-with-public-key-authentication/</guid>
		<description><![CDATA[So, I&#8217;ve been spending a fair amount of time mucking about on my DD-WRT based router and I have a few topics to cover.  They&#8217;ll all sort of build on each other and I&#8217;ll ping-back when appropriate.  I initially attempted to do them all in one colossal post and then realized that it [...]]]></description>
			<content:encoded><![CDATA[<p>So, I&#8217;ve been spending a fair amount of time mucking about on my <a target="_blank" href="http://en.wikipedia.org/wiki/DD-WRT">DD-WRT</a> based router and I have a few topics to cover.  They&#8217;ll all sort of build on each other and I&#8217;ll ping-back when appropriate.  I initially attempted to do them all in one colossal post and then realized that it just wouldn&#8217;t work.  So first things first, <a target="_blank" href="http://en.wikipedia.org/wiki/Secure_Shell">SSH</a>.</p>
<p>When I set up a personal Internet facing SSH daemon, I only allow logins via public/private key files.  This greatly improves security by eliminating the potential for brute force password cracking.  If you aren&#8217;t familiar with public key authentication, the quick of it goes something like this; you have a key pair that consists of a public and a private key.  The public key lives on the server you want to log into, and the private key lives on your computer (the client).  You can share the public key with anyone, and you should physically protect the private key with your life.  You can choose to encrypt the private key with a password (you will need to enter the password each time you attempt to authenticate with the key) or leave the password blank (which allows you to log in without a password). <strong>Note:</strong> It&#8217;s strongly suggested that you password protect your private key.</p>
<p>So what&#8217;s the point of it?  Your public key can only be used with its partner private key.  As long as your private key is safe (only you have access to it), nobody can crack your account and log in (even if they have the public key, you can&#8217;t generate a private key based on the data in the public key).  This is why I suggest encrypting the private key with a password, if you have it on a thumb drive and lose the drive, the dweeb who picks it up and wants to see what you have access too will still need to get past the password on the private key.  This gives you time to create a new keypair and update the machines you connect to.</p>
<p>I hope I made that clear, it makes more sense once you start using it.  If you&#8217;re confused at all after going through all of this, please let me know in the comments of this post, I&#8217;ll clear up what I can.</p>
<p><strong>Creating a keypair on your Linux box</strong></p>
<p>If you haven&#8217;t previously used SSH to connect to a host, you won&#8217;t have a <code>~/.ssh/</code> directory on your machine.  If you aren&#8217;t sure whether or not you&#8217;ve used SSH before, open a terminal and enter <code>ls -lad ~/.ssh</code>.  If the folder doesn&#8217;t exist, you&#8217;ll want to create it and set the proper permissions now.  The command below will create the directory with a mode of 700, only you as the owner will be able to list the contents of <code>~/.ssh</code></p>
<blockquote><p>mkdir ~/.ssh -m=u+rwx,g-rwx,o-rwx</p></blockquote>
<p>This next command will create a keypair in <code>~/.ssh/</code> as long as you have the OpenSSH Client package installed (chances are, you do).  Basically we&#8217;re creating a (standard) 2048-bit RSA keypair with a custom comment (<code>-C [comment]</code>.  If you decide not to customize the comment, ssh-keygen will insert your <code>[username]@[host]</code> as the comment).  If you don&#8217;t enter a password for your key when prompted, you won&#8217;t need to enter one when attempting logins with this keypair.  As convenient as this sounds, I would (again) suggest using a strong password to keep this keypair safe.</p>
<blockquote><p>ssh-keygen -C [comment] -f ~/.ssh/id_rsa</p></blockquote>
<p>Now that we have a keypair (<code>~/.ssh/id_rsa</code> and <code>~/.ssh/id_rsa.pub</code>), we need to log into the DD-WRT control panel, enable SSH and paste in our authorized key.</p>
<p><strong>Configure SSHd</strong></p>
<p>Open <code>~/.ssh/id_rsa.pub</code> with your editor of choice, select all of the text and copy it.</p>
<p>Next, open your browser and enter the address of the router, Click on the <em>Administration</em> tab, and then on <em>Services</em>.  Scroll down to the <em>Secure Shell</em> section and set it up as follows:</p>
<blockquote>
<ul>
<li><strong>SSHd:</strong> Enable</li>
<li><strong>Password Login:</strong> Disable</li>
<li><strong>Port:</strong> 22</li>
<li><strong>Authorized Keys:</strong> Paste in the contents of your <code>id_rsa.pub</code> file.  The actual key (the ugly part of the file) must NOT wrap, it needs to be on one line.</li>
</ul>
</blockquote>
<p><strong>Note:</strong> I ALWAYS change the port from 22 to some high number that&#8217;s easy for me to remember.  It cuts down on attempted break-ins, do whatever works for you.</p>
<p>Now that SSHd is configured, click <em>Save Settings</em> and then <em>Reboot Router</em>.<em>  At this point, you can only use SSH to log into the router from your LAN (in other words, we haven&#8217;t opened SSH up to the world yet).</em></p>
<p>Once the DD-WRT control panel is visible again, open a terminal and enter the command below:</p>
<blockquote><p>ssh root@192.168.1.1 -i ~/.ssh/id_rsa</p></blockquote>
<p>If all goes well, should see a login prompt like the one below.  You&#8217;ll need to enter the password for your private key.  After that you should be at a shell prompt.  If yes, Congrats!  You&#8217;re communicating with your router via SSH.</p>
<blockquote><p>DD-WRT v23 SP2 std (c) 2006 NewMedia-NET GmbH<br />
Release: 09/15/06 (SVN revision: 3932)<br />
Enter passphrase for key &#8216;/home/[username]/.ssh/id_rsa&#8217;</p></blockquote>
<p>Now that it&#8217;s all tested, we can open SSH up to the Internet.  This is optional of course, if you don&#8217;t want SSH access to your router from remote locations, then skip it.</p>
<p>Log into the DD-WRT control panel and select the <em>Administration</em> tab and then the <em>Management</em> tab.  In the <em>Remote Access</em> section configure as follows.</p>
<blockquote>
<ul>
<li><strong>Web GUI Management:</strong> Disable</li>
<li><strong>SSH Management:</strong> Enable</li>
<li><strong>SSH Remote Port:</strong> [same port you selected in the <em>Secure Shell</em> configuration]</li>
</ul>
</blockquote>
<p>Again, click <em>Save Settings</em> and <em>Reboot Router</em>.  After the reboot, you&#8217;re SSHd is available to you from anywhere</p>
<p><strong>Extra bit to make life easier</strong></p>
<p>Finally, if you think that&#8217;s an annoying amount of text to enter whenever you want to SSH into your router, create an SSH Config file.  Use whatever editor you like, enter the text below and save the file to <code>~/.ssh/config</code></p>
<blockquote><p>host ddwrt<br />
hostname 192.168.1.1<br />
port 22<br />
user root<br />
identityfile ~/.ssh/id_rsa</p></blockquote>
<p>Now all you need to do is enter <code>ssh ddwrt</code> to connect to your router.</p>
<p>Finally, I should mention that allowing remote &#8220;root&#8221; logins is a really bad idea.  I&#8217;ve made an exception in this case as DD-WRT is unique in that it only has one user account.  There are ways of renaming the account, if I explore them, I&#8217;ll (of course) tell you about it.</p>
]]></content:encoded>
			<wfw:commentRss>http://linuxneophyte.com/dd-wrt-ssh-remote-management-with-public-key-authentication/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>DD-WRT: My Router Runs Linux</title>
		<link>http://linuxneophyte.com/dd-wrt-my-router-runs-linux/</link>
		<comments>http://linuxneophyte.com/dd-wrt-my-router-runs-linux/#comments</comments>
		<pubDate>Sun, 07 Jan 2007 06:28:30 +0000</pubDate>
		<dc:creator>M@</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[DD-WRT]]></category>
		<category><![CDATA[Edgy]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://linuxneophyte.com/dd-wrt-my-router-runs-linux/</guid>
		<description><![CDATA[Installing DD-WRT on the Linksys WRT54GL went pretty much as the installation instructions said it would.  I made it a point to follow them EXACTLY.  Before getting started, I reviewed a lot of the info on the wiki pertaining to my particular router model as well as others.
Firstly, I powered up the router [...]]]></description>
			<content:encoded><![CDATA[<p>Installing <a target="_blank" href="http://www.dd-wrt.com">DD-WRT</a> on the <a target="_blank" href="http://en.wikipedia.org/wiki/WRT54G">Linksys WRT54GL</a> went pretty much as the installation instructions said it would.  I made it a point to follow them EXACTLY.  Before getting started, I reviewed a lot of the info on the <a target="_blank" href="http://www.dd-wrt.com/wiki/index.php/Main_Page">wiki</a> pertaining to my particular router model as well as others.</p>
<p>Firstly, I powered up the router and performed a hard reset (hold the reset button down for 30 seconds).  This just ensures that the router is using its factory default configuration.  I then unplugged my Ubuntu Edgy machine from the old router and connected it to the WRT54GL.  I reconfigured my network interface from a static address to DHCP and renewed my IP.  I did this from the command line so it looked like <code>sudo ifdown eth0 ; sudo ifup eth0</code>.</p>
<p>The firmware installation is done from the router&#8217;s web based administration panel, so using Firefox 2.0.0.1 I logged in and navigated to the firmware upload administration tab.  I used the browse button to locate <code>dd-wrt.v23_generic.bin</code> (which I had downloaded and extracted when I ordered the router) and clicked upgrade. After a few moments, I received a page telling me that the upload was successful and I walked away from the whole project for 5 minutes (as the wiki instructed me to.  I wanted a beer anyway).</p>
<p>Time passes&#8230;</p>
<p>Back at the keyboard now, I click the <em>Continue</em> button and I&#8217;m presented with a white page and some fields asking for my username and password.  I close Firefox, perform another hard reset of the router, open Firefox again and enter the address of router.  Just like magic, I&#8217;m presented with the DD-WRT configuration pages of the router.  Success!</p>
<p>Since it&#8217;s late and I just want to get things working, I&#8217;m only doing the basics, setting up static DHCP and a new wireless SSID.</p>
<p>Step one, change the default password from &#8220;admin&#8221; to something much, much better.  Next, I collect all of the MAC addresses from the machines on my network and make my way to the Administration/Services tab.  There, I assigned the MAC addresses to host names/IP addresses and configured my LAN domain name (just something I like to play with).  I started testing DCHP by connecting to each of the Linux machines, changing them from a static to a DHCP configuration and renewing the IP address (same commands as above).  Flawless!  With the Linux machines done I configure the rest of the machines on the network the same way.</p>
<p>Next, I create a new wireless SSID and configure my two wireless machines to associate with it.  This is where I had a little trouble.  Everything but the Ubuntu install on the laptop connected without issue.  For whatever reason I just can&#8217;t get the bcm4306 based wireless card to associate with the router using manually configured NDISwrapper.  I&#8217;ll revisit this when I&#8217;m not so tired <img src='http://linuxneophyte.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Update:</strong>  I think I have this fixed, I&#8217;ll tell you how in another post</p>
<p>I know I said I was only doing the basics, but I had to try SSH.  So back to the Services tab, I enable SSH management (and disable Telnet as I&#8217;ll never use it) and click the <em>Reboot Router</em> button.  Next, I open a terminal session and enter <code>ssh dd-wrt</code>.  I log in with my user/pass and I&#8217;m at an ASH shell prompt.  The output from a <code>uname -r</code> reads like <code>Linux DDWRT 2.4.34-pre2 #170 Fri Sep 15 20:10:21 CEST 2006 mips unknown</code>.  Pretty sexy <img src='http://linuxneophyte.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>All in all it was a satisfying experience.  I&#8217;m running Linux on my router and there&#8217;s a LOT of cool things I can do.  I haven&#8217;t scratched the surface yet, I&#8217;ll be exploring options for a while and when I come across something sweet I&#8217;ll post about it here.  If you&#8217;re at all interested in exploring DD-WRT, start by checking out the compatibility list and reading up on the features.  The wiki is a great place to start.  I had no trouble ordering a 100% compatible router for around $55.00 US (there was a rebate).</p>
<p>If you&#8217;re new to Linux and don&#8217;t want to have to manage your router from a command shell, no worries.  The web configuration pages are extremely useful and cover the full configuration of the router in a point and click fashion.  You just can&#8217;t go wrong <img src='http://linuxneophyte.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://linuxneophyte.com/dd-wrt-my-router-runs-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Play Time: Beryl, VMware and Future Blogs</title>
		<link>http://linuxneophyte.com/linux-play-time-beryl-vmware-and-future-blogs/</link>
		<comments>http://linuxneophyte.com/linux-play-time-beryl-vmware-and-future-blogs/#comments</comments>
		<pubDate>Sat, 18 Nov 2006 00:55:24 +0000</pubDate>
		<dc:creator>M@</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Beryl]]></category>
		<category><![CDATA[Compiz]]></category>
		<category><![CDATA[Edgy]]></category>
		<category><![CDATA[Eye Candy]]></category>
		<category><![CDATA[FC6]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://newbie.linuxworldnet.com/linux-play-time-beryl-vmware-and-future-blogs/</guid>
		<description><![CDATA[I was able to leave work early today, I LOVE when that happens..  I took care of some personal responsibilities and came home to beer and some time with my desktop.  I haven&#8217;t had a lot of time to really play since I installed Edgy.
Beryl:
I gotta say, the Beryl project is extremely cool. [...]]]></description>
			<content:encoded><![CDATA[<p>I was able to leave work early today, I LOVE when that happens..  I took care of some personal responsibilities and came home to beer and some time with my desktop.  I haven&#8217;t had a lot of time to really play since I installed Edgy.</p>
<p><strong>Beryl:</strong></p>
<p>I gotta say, the Beryl project is extremely cool.  I had a great time picking out a skydome wallpaper and just tweaking out the desktop effects.  I had to kill off the trailfocus plugin in beryl, I was getting annoyed with the fading out of apps.  Other than that, I couldn&#8217;t be happier with the software.  It&#8217;s just amazing.  I have a nice fresh looking desktop with fun effects that just may help convince a few others to give Linux a shot (you KNOW anyone coming into this abode will be visiting my machine).  Yeah, yeah, eye candy isn&#8217;t the reason to switch operating systems.  That doesn&#8217;t mean that it won&#8217;t have an impact on some of those who are more reluctant to make the change.  Who knows?</p>
<p>On the topic of Beryl, it seems that the folks over at Fedora are creating packages for it.  That&#8217;s excellent news!  I&#8217;ve noticed that Beryl core and Beryl devel have made it into the repos.  I&#8217;m hoping that they&#8217;re planning to create packages for the plugins and extra toys as well.</p>
<p><strong>*Note:</strong> if you followed the instructions for installing Beryl 0.1.1 in <a target="_blank" href="http://linuxneophyte.com/beryl-on-fedora-core-6/">this post</a>, and you update to the latest version in the Fedora repos, you WILL break Beryl.  The good news is that  it&#8217;s easy to fix.  The RPMs referenced in the post have been updated to v 0.1.2.  You can just download and install all of the packages except for core and devel (the post explains how if you don&#8217;t know what I&#8217;m talking about). After that, Beryl will be back, and up-to-date.  Be sure to play with the &#8220;burn&#8221; animation.  It looks NICE, but IMO it gets too annoying to use regularly.  I wouldn&#8217;t mind seeing a &#8220;smoke&#8221; animation.  Something that turns into wisps of smoke when you close an app could be pretty sexy <img src='http://linuxneophyte.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>VMware:</strong></p>
<p>I took some time today to set up some test VMware appliances for LinuxWorldNet.  I&#8217;ll be using these &#8220;machines&#8221; to explore software and record my steps so I can post some how-to&#8217;s here.  I&#8217;ve mostly completed the Fedora install, I&#8217;ll be working on Edgy shortly and I&#8217;ve created a Debian stable server for testing.</p>
<p><strong>Upcoming Things:</strong></p>
<p>I&#8217;ll be using the Debian VM to test out some FTP servers for Linux.  I currently use Gene6 for Windows and would like to make the move to one of my Linux machines.  I have no idea how well this will work out, I&#8217;ll post about my ups and downs here.  Its going to be tough for any FTP server to beat G6, that&#8217;s just an amazing app.  As I get into it, I&#8217;ll tell you what my requirements are and we&#8217;ll see how far I can get <img src='http://linuxneophyte.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I also plan on covering the configuration of OpenSSH server for both Fedora and Ubuntu.  I&#8217;ll explain how to set them up in the most paranoid way I know how.  I&#8217;m hoping that any newbies stumbling upon this blog will be able to open his/her SSH server to the evils of the Internet and still feel confident that they will be as safe as can possibly be.</p>
<p>That&#8217;s pretty much it for now.  The only other thing I&#8217;d like to put out there is this; I&#8217;d like to hear from anyone that checks this blog out and has a few minutes to fire off a comment or email (matt at linuxworldnet dot com).  Let me know what you think or if there&#8217;s a topic you&#8217;d like covered (I&#8217;ll do what I can, I&#8217;m still new to this Linux thing myself).</p>
<p>I need to get back to my beer and play, laydah!</p>
]]></content:encoded>
			<wfw:commentRss>http://linuxneophyte.com/linux-play-time-beryl-vmware-and-future-blogs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
