Difference between revisions of "Install from SSH"

From ArchWiki
Jump to: navigation, search
(2. Setup the Live Environment to use SSH)
Line 16: Line 16:
 
{{Note|This part will require physical access to the machine.  Obviously, if physically located elsewhere, this will need to be coordinated with another person!}}
 
{{Note|This part will require physical access to the machine.  Obviously, if physically located elsewhere, this will need to be coordinated with another person!}}
  
One should be presented with the root prompt '''[root@archiso ~]#''' at this point. Complete the following commands:
+
One should be presented with the root prompt '''[root@archiso ~]#''' at this point.
  
  aif -partial-configure-network # setup the network
+
Firstly, setup the network on the target machine:
  pacman -Syy # update the live environment's syncdb
+
  aif -partial-configure-network
  pacman -S openssh # self explanatory
+
echo "sshd: ALL" >> /etc/hosts.allow # by default arch denies all connections
+
Secondly, sync the live environment to a mirror, install the openssh package, and start it:
passwd # set a password for the live environment's root user
+
  pacman -Syy  
 +
  pacman -S openssh
 
  /etc/rc.d/sshd start # self explanatory
 
  /etc/rc.d/sshd start # self explanatory
 +
 +
{{Note|Depending on the age of the install media, pacman may complain that '''it''' should be upgraded first.  Since the goal is to simply install the openssh package, it s recommended to deny this request and simply install the single package.}}
 +
 +
<pre># pacman -S  openssh
 +
:: The following packages should be upgraded first :
 +
    pacman 
 +
:: Do you want to cancel the current operation
 +
:: and upgrade these packages now? [Y/n] n</pre>
 +
 +
Finally, allow sshd connections and setup a root password which is needed for an ssh connection; the default arch password for root is empty.
 +
 +
echo "sshd: ALL" >> /etc/hosts.allow
 +
passwd
  
 
===3. Connect to the Target PC via SSH ===
 
===3. Connect to the Target PC via SSH ===

Revision as of 13:45, 23 December 2010

Intro

This article is intended to show users how to install Arch remotely via an SSH connection. Consider this approach over the standard one in scenarios such the following:

Setting up Arch on...

  • HTPC without a proper monitor (i.e. an SDTV).
  • A PC located in another city, state, country.
  • A PC that you would rather setup remotely, for example from the comfort of one's own workstation with copy/paste abilities from the Arch Wiki.

Setup the Target System

1. Boot from Media

Note: This part will require physical access to the machine. Obviously, if physically located elsewhere, this will need to be coordinated with another person!

Boot into a live Arch environment via the [live CD/USB image] and log in as root.

2. Setup the Live Environment to use SSH

Note: This part will require physical access to the machine. Obviously, if physically located elsewhere, this will need to be coordinated with another person!

One should be presented with the root prompt [root@archiso ~]# at this point.

Firstly, setup the network on the target machine:

aif -partial-configure-network

Secondly, sync the live environment to a mirror, install the openssh package, and start it:

pacman -Syy 
pacman -S openssh
/etc/rc.d/sshd start # self explanatory
Note: Depending on the age of the install media, pacman may complain that it should be upgraded first. Since the goal is to simply install the openssh package, it s recommended to deny this request and simply install the single package.
# pacman -S  openssh
:: The following packages should be upgraded first :
    pacman  
:: Do you want to cancel the current operation
:: and upgrade these packages now? [Y/n] n

Finally, allow sshd connections and setup a root password which is needed for an ssh connection; the default arch password for root is empty.

echo "sshd: ALL" >> /etc/hosts.allow
passwd

3. Connect to the Target PC via SSH

Connect to the target machine via the following command

$ ssh root@ip.address.of.target

From here one is presented with live environment's the welcome message and is able to administer the target machine as-if sitting at the physical keyboard.

$ ssh root@10.1.10.105
root@10.1.10.105's password: 
Last login: Thu Dec 23 08:33:02 2010 from 10.1.10.200
**************************************************************
* To begin installation, run /arch/setup                     *
* You can find documentation at                              *
*  /usr/share/aif/docs/official_installation_guide_en        *
*                                                            *
* i18n: Use the 'km' utility to change your keyboard layout  *
*       and console font.                                    *
*                                                            *
* If you are looking to install Arch on something more       *
* exotic, such as your kerosene-powered cheese grater,       *
* please consult http://wiki.archlinux.org.                  *
*                                                            *
**************************************************************
[root@archiso ~]#

Notes

  • If the target machine is behind a firewall/router, the default ssh port of 22 will obviously need to be forward to the target machine's LAN IP address. The use of port forwarding is not covered in this guide.
  • One can edit Template:Filename on the live environment prior to starting the daemon for example to run on a non-standard port if desired.