How to start networking in single-user mode in Debian?

Kernels & Hardware, configuring network, installing services

How to start networking in single-user mode in Debian?

Postby bgoodr » 2011-11-19 17:46

The Context:

By "single-user mode" I mean "recovery mode" from the GRUB menu.

I am in the process of upgrading a laptop from Debian stable to Debian testing from single-user mode (via using -download-only while in multiuser mode initially, and continuing the upgrade in -no-download mode from single-user). I have a separate Debian desktop machine that is not being upgraded, and is on the same LAN as the laptop. I need to be able to post logs of what I happened here (in a separate thread) in order to receive additional help, but I cannot do so because I could not get networking to start from single-user mode so as to ssh out of the laptop to my desktop, or set up sshd on the laptop so as to ssh from the desktop to the laptop (the latter being my preference).

Just in case the what I did during the upgrade is germane to network startup, here are the sequence of commands that I issued on the laptop during the upgrade:

Code: Select all
# under multi-user mode just to download everything (and hey!! it should have pulled down everything but I think it did NOT):
apt-get --download-only update && apt-get --download-only -y dist-upgrade >debian.upgrade.log.1 2>&1
# under single-user mode:
apt-get --no-download update && apt-get --no-download -y dist-upgrade >debian.upgrade.log.2 2>&1
# The above command failed.


It is the two log files above that I need to pull out of the laptop for a future forum post.

The Question:

Without rebooting the laptop, how do I start networking in such a way that I can then start sshd on the laptop, or be able to ssh out of the laptop? Also, I would like to avoid modifying configuration files, that is, unless that is the only way I can get networking started.

I do not want to reboot the laptop because I might not be able to get back to single-user mode due to the original failure mode. I believe the same might be true by switching from single-user mode to some higher run-level just to get networking running.

What I tried:

I tried just starting the eth0 interface via:

Code: Select all
# ifup eth0
Ignoring unknown interface eth0=eth0.


That puzzled me, so I examined one of the network configuration files:

Code: Select all
# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
#NetworkManager#iface eth0 inet dhcp


Maybe I could temporarily change the last line of that file above to instead read:

Code: Select all
iface eth0 inet dhcp


And then rerun the ifup eth0 command again. But, that is modifying configuration files. So, what are the list of commands that I can type in at the single-user root shell command prompt to start networking and also to then start sshd, without modifying configuration files?

Thanks in advance for any assistance!
bg
User avatar
bgoodr
 
Posts: 68
Joined: 2008-07-27 20:53

Re: How to start networking in single-user mode in Debian?

Postby vbrummond » 2011-11-19 18:24

I always start ethernet simply by running dhclient eth0
System: Retina 5K iMac, 27-inch, Late 2015 - Intel i5-6600 3.3ghz, 8gb RAM, AMD Radeon R9 M395 2048 MB
OS: Mac OS 10.12
vbrummond
 
Posts: 4417
Joined: 2010-03-02 01:42

Re: How to start networking in single-user mode in Debian?

Postby bgoodr » 2011-11-19 18:59

vbrummond wrote:I always start ethernet simply by running dhclient eth0


Thanks! That worked like a charm. I can now sshd into the laptop.

bg
User avatar
bgoodr
 
Posts: 68
Joined: 2008-07-27 20:53

Re: How to start networking in single-user mode in Debian?

Postby tedrogers » 2017-08-25 15:54

vbrummond wrote:I always start ethernet simply by running dhclient eth0


For me simply dhclient in rescue and it worked. Thanks, this saved my butt!
tedrogers
 
Posts: 27
Joined: 2017-08-23 19:19

Re: How to start networking in single-user mode in Debian?

Postby bgoodr » 2017-08-26 00:33

tedrogers wrote:
vbrummond wrote:I always start ethernet simply by running dhclient eth0


For me simply dhclient in rescue and it worked. Thanks, this saved my butt!


Very glad that worked for you.

Dang. That was one helluva necrobump from 2011. Made my day! 8)
User avatar
bgoodr
 
Posts: 68
Joined: 2008-07-27 20:53


Return to System configuration

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable