Headless machine set up by brainless tech
February 4, 2010 10:34 PM   Subscribe

My Linux machine has no monitor, which is fine, except I forgot to install SSHD. Help!

Just did a fresh install of Debian stable, parked the server in the closet, and loaned my monitor to a friend (before you ask the obvious question, I'm posting this from a laptop.) Unfortunately I can't finish configuring the machine because I forgot to install SSHD (yes, I'm an idiot.)

Anyone out there with Debian stable, I would love to get the step-by-step keystrokes to get me through the configuration steps after doing this:

login: [user][enter]
password: [password][enter]
> sudo apt-get install ssh[enter]
[sudo password][enter]

I know at this point it'll ask me config questions, including the magic one ("do you want to run sshd?") but I don't know which questions, which order, or whether it defaults to yes or no on each. Bluh.

It's a hail mary, but here I am, asking anyway. Thanks if you're a Debian guy and patient enough to run the installer and document the steps.
posted by davejay to Technology (11 answers total) 5 users marked this as a favorite
I'll run through it on a crunchbang box a post the steps, should be the same. Please stay tuned.
posted by jjb at 10:47 PM on February 4, 2010

sudo apt-get install openssh-server

Worked for me on a Karmic box. There were no dependency questions. The service started automatically, too. I can't remember the last time I was prompted to start openssh-server upon install - it's been automatic for a while.
posted by cdmwebs at 10:48 PM on February 4, 2010

Best answer: At least in ubuntu, the setup seems to require little, if any configuration: (see this image)

If I were you, I'd give it a shot with the default settings, which are generally sensible. After apt-get install ssh, wait a few seconds, give it a 'Y', and maybe an extra enter or two to be safe, then try sshing in from your laptop (assuming, of course that you know the IP - maybe from your router settings?)
posted by chrisamiller at 10:49 PM on February 4, 2010

Response by poster: Holy crap, I took a huge guess (as suggested by chrisamiller) and got it in one!

For the record, I logged in as root for convenience, then did:

apt-get install ssh
(wait for disk to stop churning and network lights to stop)
(wait for disk to stop churning and network lights to stop)
(wait for disk to stop churning and network lights to stop)
(wait for disk to stop churning and network lights to stop)
(wait for disk to stop churning and network lights to stop)
(wait for disk to stop churning and network lights to stop)

Then I went and logged right in without issue. What are the odds?

Now off to run dpkg-configure ssh and fix any stupid 'y' configuration options. Thanks jjb for being wiling to run it, and chrisamiller for suggesting I just go for it.
posted by davejay at 10:51 PM on February 4, 2010

So, picking up where you left off:

...KB of additional diskspace used.
Do you want to continue? [Y/n]

(wait FOREVER because I forgot to switch off of the Canadian mirror....)

And that seems to be it.
keys are generated and the daemon is running with no further input. I don't have a debian box at the moment to be 100% sure.

The box doesn't happen to have an out you could hook a tv up to?
posted by jjb at 10:53 PM on February 4, 2010

Hah, glad you got it going.
posted by jjb at 10:54 PM on February 4, 2010

Best answer: For future reference, you can type

yes | sudo apt-get install openssh-server

The yes command repeatedly outputs the line 'y'. To test it type yes in the terminal.
posted by null terminated at 11:01 PM on February 4, 2010 [4 favorites]

You may also want to enable a boot serial console in case sshd dies or you need to run fsck in single user mode later.
posted by benzenedream at 1:51 AM on February 5, 2010 [1 favorite]

Best answer: instead of piping yes to apt-get, you can just pass the -y flag

apt-get -y install pacakgename
posted by namewithoutwords at 4:37 AM on February 5, 2010 [2 favorites]

namewithoutwords's solution will also avoid accidentally removing packages and suchlike - see the man page for apt-get.
posted by topynate at 5:53 AM on February 5, 2010

Response by poster: nt, nww, fantastic -- that'll be useful even when I can see what I'm doing. Thanks!
posted by davejay at 7:25 PM on February 5, 2010

« Older Save the clothes!   |   Private hosting for text files? Newer »
This thread is closed to new comments.