Skip to content

Instantly share code, notes, and snippets.

@Kqpa
Last active February 1, 2022 13:58
Show Gist options
  • Save Kqpa/e418d0f5b283304b8d423fcbed10df16 to your computer and use it in GitHub Desktop.
Save Kqpa/e418d0f5b283304b8d423fcbed10df16 to your computer and use it in GitHub Desktop.
SSH Into Live Arch Environment

SSH Into Live Arch Environment

This guide will show you how to SSH into your live Arch Linux environment to do your installation remotely, assuming that you have just plugged in your bootable media to start the installation and you are the root user.


Connecting to the Internet

If you have an ethernet cable plugged into your machine, you can skip this step. If you don't, follow along:

1: Check if WiFi is blocked:

rfkill list

If it says Soft blocked: yes, run rfkill unblock wifi.

2: Start the iwd service if it's not already running:

systemctl start iwd.service 

To check if it's working or not, run systemctl status iwd.service.

3: Enter the interactive prompt, this is a command line utility that allows you to configure your network connection:

iwctl

4: Find your device name:

device list

5: Scan your device:

station <device name> scan

6: Find the networks in your device after scanning:

station <device name> get-networks

7: Connect to your network, when the command is ran, it will ask you to enter your network password:

station <device name> connect <network name>

After you're done, run exit and try pinging a server to see if you're actually connected to the internet (e.g. ping google.com). If you get an error like ping: cannot resolve google.com: Unknown host re-do the steps and make sure you are entering the correct commands, device name, network name and password.


Get Your Local IP Address

To get your local IP address, run:

ip addr

commandoutput

Your local IP should be a string like 192.168.X.X.


Install & Start OpenSSH

1: Install OpenSSH:

pacman -Sy openssh

2: Start OpenSSH:

systemctl start sshd.service

To check if it's working or not, run systemctl status sshd.service.


Setting a root User Password

A password is required for the root user in order to SSH.

To set a password, run:

passwd

This will ask you to enter a password and I suggest making it something like "root" or "password", because this will not be your actual root user password when you finish the installation.


SSH into Arch

Now that you have everything ready, run:

ssh root@<localIP>

It will ask if you're sure if you want to connect, enter yes. After that, enter the root password you set and now you are in your live Arch environment. To terminate the connection, run exit.

If anything goes wrong, try removing the ~/.ssh folder from your host machine and try again.

@stampe99
Copy link

stampe99 commented Jan 9, 2022

good guide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment