How linux servers boot with no login?

0

I am in the process of building my first development server and plan on running Ubuntu Server as the OS. This morning, I was doing some initial designs for it and it got me thinking: how do "headless Linux" systems (terminal-only systems with no desktop/window environment) boot without prompting any user to login?

With a desktop Linux server, such as Ubuntu Server, when I start the machineit prompts me for a username and password; I have to login before I can use the system or access it remotely (which is what I intend to do).

How does a "headless Linux" server work? When you turn the machine on, since there is no terminal/monitor/UI to interact with, how do users connect remotely (with a remote desktop tool for instance) to it and begin using it when the OS hasn't even finished loading yet (which is what I assume is happening when you log in to the machine at startup with a desktop server)? Thanks in advance!

pnongrata

Posted 2012-08-06T11:34:20.127

Reputation: 2 212

Answers

1

Headless machines are configured to start automatically all the services needed to use them and log into them. Usually, ssh is the primary means of connecting to the server from the outside world.

David Schwartz

Posted 2012-08-06T11:34:20.127

Reputation: 58 310

Thanks @David Schwartz (+1) - but I'm still not seeing the "forest through the trees." Say I write my own daemon service, my-svc.exe and I want it to start when the physical machine is booted up. What are the series of steps I would need to go through to configure my-svc.exe to start at machine startup, login to the OS as you say, and be available for use by clients? Thanks again! – pnongrata – 2012-08-06T11:54:58.233

1

You create an entry for the service in your distribution's service manager and set it to enabled in whichever startup profile you start up in. I don't know specifically what Ubuntu uses, whether it's upstart, systemd, or whatever. But each startup manager has the idea of different startup profiles with services that are enabled on startup for each profile. (Update: Ubuntu uses upstart -- set start on startup if you want a job to start on startup.)

– David Schwartz – 2012-08-06T11:56:12.833

Ahh, so therein lies the root of my confusion: as you said, it looks like you can choose a startup profile when you power-on the machine, yes? If so, how does the machine know which startup profile to use (i.e. can you define a "default profile")? Thanks again (and +1 for the research)! – pnongrata – 2012-08-06T12:03:16.633

That's correct. Usually, after installation, the default profile is "multi-user networking, plus GUI". Upstart allows you to use runlevels.

– David Schwartz – 2012-08-06T12:05:53.117