Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

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

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
User avatar
bgoodr
Posts: 68
Joined: 2008-07-27 20:53

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

#1 Post by bgoodr »

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

vbrummond
Posts: 4432
Joined: 2010-03-02 01:42

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

#2 Post by vbrummond »

I always start ethernet simply by running dhclient eth0
Always on Debian Testing

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

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

#3 Post by bgoodr »

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

tedrogers
Posts: 27
Joined: 2017-08-23 19:19

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

#4 Post by tedrogers »

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!

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

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

#5 Post by bgoodr »

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)

Post Reply