<?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>Computer Support &#187; Remote access</title>
	<atom:link href="http://www.xiitec.com/blog/category/system-administration/unix/remote-access/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xiitec.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 30 Dec 2009 08:40:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Shutting Down ssh-agent Automatically at Logout</title>
		<link>http://www.xiitec.com/blog/2008/02/05/shutting-down-ssh-agent-automatically-at-logout/</link>
		<comments>http://www.xiitec.com/blog/2008/02/05/shutting-down-ssh-agent-automatically-at-logout/#comments</comments>
		<pubDate>Wed, 06 Feb 2008 01:16:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Remote access]]></category>
		<category><![CDATA[logout]]></category>
		<category><![CDATA[shut down]]></category>
		<category><![CDATA[ssh-agent]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=103</guid>
		<description><![CDATA[Make this entry in your ~/.bash_logout file:
kill $SSH_AGENT_PID
Don&#8217;t do this if you&#8217;re using keychain, because the whole point of using keychain is to be able to log in and out without having to re-enter your passphrases.
If you don&#8217;t have a ~/.bash_logout file, create one. There should be a system-wide default logout file at /etc/skel/.bash_logout to [...]]]></description>
			<content:encoded><![CDATA[<p>Make this entry in your <code>~/.bash_logout</code> file:</p>
<blockquote><p>kill $SSH_AGENT_PID</p></blockquote>
<p>Don&#8217;t do this if you&#8217;re using keychain, because the whole point of using keychain is to be able to log in and out without having to re-enter your passphrases.</p>
<p>If you don&#8217;t have a <code>~/.bash_logout </code>file, create one. There should be a system-wide default logout file at <code>/etc/skel/.bash_logout</code> to use as a model.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2008/02/05/shutting-down-ssh-agent-automatically-at-logout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Passwordless Logins with keychain</title>
		<link>http://www.xiitec.com/blog/2008/02/05/passwordless-logins-with-keychain/</link>
		<comments>http://www.xiitec.com/blog/2008/02/05/passwordless-logins-with-keychain/#comments</comments>
		<pubDate>Wed, 06 Feb 2008 01:13:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Remote access]]></category>
		<category><![CDATA[keychain]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[passwordless]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=102</guid>
		<description><![CDATA[First, set up your system to use ssh-agent. Then use keychain to keep your SSH passphrases alive, system-wide, until you reboot. keychain also makes it possible to run SSH transfers from cron.
Download and install keychain from the usual sources; it comes in RPMs, .debs, and sources. Then edit your local ~/.bash_profile, adding these lines:
keychain id_dsa
. [...]]]></description>
			<content:encoded><![CDATA[<p>First, set up your system to use ssh-agent. Then use keychain to keep your SSH passphrases alive, system-wide, until you reboot. keychain also makes it possible to run SSH transfers from cron.</p>
<p>Download and install keychain from the usual sources; it comes in RPMs, .debs, and sources. Then edit your local ~/.bash_profile, adding these lines:</p>
<blockquote><p>keychain id_dsa<br />
. ~/.keychain/$HOSTNAME-sh</p></blockquote>
<p>Use the real name of your private key: <code>id_rsa, my_own_groovy_key</code>, whatever. Be sure to use the leading dot on the second line; this tells Bash to read the file named on the line.</p>
<p>That&#8217;s all you have to do. Now when you log in to your local workstation, a keychain prompt will appear, asking for the passphrase of your key. keychain will handle authentications until the system reboots.</p>
<p>You can name as many keys as you wish to use, like this:</p>
<blockquote><p>keychain id_dsa  apache_key  ftp_key</p></blockquote>
<p>You&#8217;ll enter the passphrase for each one at system login. Then keychain will handle authentications as long as the system stays up, even if you log out and log back in a few times. When you restart the system, you start over.</p>
<p>A lot of documentation tells you to use null passphrases on keys generated for servers, to enable unattended reboots. The risk is that anyone who gets a copy of the private key will be able to easily misuse it. As always, you&#8217;ll have to decide for yourself what balance of convenience and security is going to serve your needs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2008/02/05/passwordless-logins-with-keychain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tunneling X over SSH</title>
		<link>http://www.xiitec.com/blog/2008/02/04/tunneling-x-over-ssh/</link>
		<comments>http://www.xiitec.com/blog/2008/02/04/tunneling-x-over-ssh/#comments</comments>
		<pubDate>Mon, 04 Feb 2008 23:50:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Remote access]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[tunneling]]></category>
		<category><![CDATA[X11]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=99</guid>
		<description><![CDATA[You like running remote X sessions, but you know that they are completely insecure, so you want to run X over SSH.
Enable X forwarding on the SSH server, in /etc/ssh/sshd_config. Then use the -X flag when you start your SSH session.

Put this line in /etc/ssh/sshd_config on the SSH server:
X11Forwarding yes
Then connect to the server with [...]]]></description>
			<content:encoded><![CDATA[<p>You like running remote X sessions, but you know that they are completely insecure, so you want to run X over SSH.</p>
<p>Enable X forwarding on the SSH server, in <code>/etc/ssh/sshd_config</code>. Then use the <code>-X</code> flag when you start your SSH session.</p>
<p><span id="more-99"></span></p>
<p>Put this line in <code>/etc/ssh/sshd_config</code> on the SSH server:</p>
<blockquote><p>X11Forwarding yes</p></blockquote>
<p>Then connect to the server with the -X flag:</p>
<blockquote><p>$ ssh -X saturn.test.net</p></blockquote>
<p>Run this command to test that X forwarding is working:</p>
<blockquote><p>$ echo $DISPLAY<br />
localhost:10.0</p></blockquote>
<p>If it weren&#8217;t, it would return a blank line. Now you can run any X program installed on the server as though it were local. Try this for a simple test:</p>
<blockquote><p>$ xeyes</p></blockquote>
<p>Or run <code>glxgears</code>, or any X program that is installed on the server.</p>
<p>Using SSH for remote X sessions is both simpler and more secure than running a plain-vanilla X session without SSH, which is not secure at all. However, it still carries some risks. Use this to connect only to trusted hosts, because a snoopy admin can easily capture your keystrokes or logins, or even connect to your local desktop and snoop even more. Make sure your local ~/.Xauthority file is mode 600, to prevent unprivileged users on the remote host from also joining in the snooping.</p>
<p>Be sure that these entries are in your local <code>/etc/ssh/ssh_config</code> file and any <code>~/ ssh/ssh_config</code> files on your system:</p>
<blockquote><p> Host *<br />
ForwardX11 no<br />
ForwardAgent no</p></blockquote>
<p>It&#8217;s important to ensure that X forwarding is turned off, except when you absolutely need it.</p>
<p>Depending on your physical distance from the remote server and the speed of your network connection, you may notice some lag in your keystrokes or mouse movements, as the X protocol is a bit of a network hog.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2008/02/04/tunneling-x-over-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generating New Host Keys</title>
		<link>http://www.xiitec.com/blog/2008/02/04/generating-new-host-keys/</link>
		<comments>http://www.xiitec.com/blog/2008/02/04/generating-new-host-keys/#comments</comments>
		<pubDate>Mon, 04 Feb 2008 23:43:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Remote access]]></category>
		<category><![CDATA[generate]]></category>
		<category><![CDATA[host keys]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=98</guid>
		<description><![CDATA[You looked in /etc/ssh and didn&#8217;t see any key files: your Linux distribution did not generate host keys when you installed OpenSSH. Or you just want to create new host keys yourself.

Use ssh-keygen to create a new key pair. This must be done as root, and you have to specify the name of the new [...]]]></description>
			<content:encoded><![CDATA[<p>You looked in <code>/etc/ssh</code> and didn&#8217;t see any key files: your Linux distribution did not generate host keys when you installed OpenSSH. Or you just want to create new host keys yourself.</p>
<p><span id="more-98"></span></p>
<p>Use <code>ssh-keygen</code> to create a new key pair. This must be done as root, and you have to specify the name of the new key pair. You only need one key pair. Always specify a passphrase:</p>
<blockquote><p># ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key<br />
Generating public/private rsa key pair.<br />
Enter passphrase (empty for no passphrase):<br />
Enter same passphrase again:<br />
Your identification has been saved in /etc/ssh/ssh_host_rsa_key.<br />
Your public key has been saved in /etc/ssh/ssh_host_rsa_key.pub.<br />
The key fingerprint is:<br />
6c:24:75:54:d3:21:17:c9:11:db:41:dd:95:3f:d0:ac root@windbag</p></blockquote>
<p>This example uses the default key names, but you can call the keys anything you like. If you use different names, be sure to enter them in <code>/etc/ssh/sshd_config</code>:</p>
<blockquote><p> # HostKeys for protocol version 2<br />
HostKey /etc/ssh/ssh_host_rsa_key</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2008/02/04/generating-new-host-keys/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting Up OpenSSH the First Time</title>
		<link>http://www.xiitec.com/blog/2008/02/04/setting-up-openssh-the-first-time/</link>
		<comments>http://www.xiitec.com/blog/2008/02/04/setting-up-openssh-the-first-time/#comments</comments>
		<pubDate>Mon, 04 Feb 2008 21:53:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Remote access]]></category>
		<category><![CDATA[OpenSSH]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=97</guid>
		<description><![CDATA[Install OpenSSH on both machines. sshd, the ssh daemon, must be running on the remote host, so that it can receive connections. Copy the remote host&#8217;s public key to the local machine&#8217;s ~/.ssh/known_hosts file, and you&#8217;re in business.

Starting and stopping sshd on most rpm-based systems is done like this:
# /etc/init.d/sshd start
# /etc/init.d/sshd stop
On Debian, it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Install OpenSSH on both machines. <code>sshd</code>, the ssh daemon, must be running on the remote host, so that it can receive connections. Copy the remote host&#8217;s public key to the local machine&#8217;s <code>~/.ssh/known_hosts </code>file, and you&#8217;re in business.</p>
<p><span id="more-97"></span></p>
<p>Starting and stopping sshd on most rpm-based systems is done like this:</p>
<blockquote><p># /etc/init.d/sshd start<br />
# /etc/init.d/sshd stop</p></blockquote>
<p>On Debian, it&#8217;s slightly different:</p>
<blockquote><p># /etc/init.d/ssh start<br />
# /etc/init.d/ssh stop</p></blockquote>
<p>Always check your init filenames, as they vary on different distributions.</p>
<p>Copying the remote host&#8217;s public key to your local <code>~/.ssh/known_hosts</code> file is as simple as connecting to the remote host:</p>
<blockquote><p>carla@windbag carla$ ssh stinkpad<br />
The authenticity of host &#8217;stinkpad (192.168.1.100)&#8217; can&#8217;t be established.<br />
RSA key fingerprint is a2:c6:70:3e:73:00:b3:ed:90:b1:9a:bc:e7:d5:32:ba.<br />
Are you sure you want to continue connecting (yes/no)?</p></blockquote>
<p>Type yes, and it will respond:</p>
<blockquote><p>Warning: Permanently added &#8217;stinkpad,192.168.1.100&#8242; (RSA) to the list of known hosts.<br />
carla@stinkpad&#8217;s password:<br />
Linux stinkpad 2.4.21 #1 Sun Aug 3 20:15:59 PDT 2003 i686 GNU/Linux<br />
Libranet GNU/Linux<br />
Last login: Sat June  3 22:16:24 2004 from :0.0<br />
carla@stinkpad:~$</p></blockquote>
<p>Using the simple <code>ssh <hostname></hostname></code> login connects you to another host on your LAN, using the same login. You can connect as a different user with the <code>-l</code> flag:</p>
<blockquote><p>carla@windbag ~$ ssh -l wilmaf stinkpad</p></blockquote>
<p>To make an SSH connection over the Internet, you must use the full domain name:</p>
<blockquote><p>carla@windbag ~$ ssh stinkpad.test.net</p></blockquote>
<p>Making that initial connection, and copying the host&#8217;s RSA key, is the riskiest part of setting up SSH. If an intruder managed to compromise your nameserver, she could possibly hijack your SSH session and capture your login. It&#8217;s a pretty small risk, though, and you can verify the IP address before logging in the first time. To close off this hole, you can manually copy the host&#8217;s public key to your local <code>~/.ssh/known_hosts</code> file first. You must edit it slightly; see the examples below.</p>
<p>Host keys are stored in <code>/etc/ssh</code>. These are used to validate the identity of the remote host. This is all you need to allow users to access this machine. All they need is a copy of the public host key in their <code>~/.ssh/known_hosts</code> files and an account to log into. Some Linux distributions create two key pairs when you install OpenSSH—one RSA key pair and one DSA key pair:</p>
<blockquote><p>$ ls /etc/ssh<br />
ssh_host_dsa_key<br />
ssh_host_dsa_key.pub<br />
ssh_host_rsa_key<br />
ssh_host_rsa_key.pub</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2008/02/04/setting-up-openssh-the-first-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

