You are not logged in.

#1 2008-07-07 04:36:13

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

sshd at bootup

I have sshd running so I can ssh into my machine from work. Works fine, no complaints about that.
But, if I reboot remotely I lose connection and unable to ssh back in until I log back in locally again.

Is it normal for sshd to only be running when a user is logged in locally?
Can I have sshd running on bootup so I can remote in regardless of whether or not a user is logged in locally?
When I say running on bootup, it does anyway. I don't manually have to run it, it runs automatically but only after I have logged in.

Something simple I'm doing wrong here I know it...


neutral

Offline

#2 2008-07-07 05:36:17

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: sshd at bootup

If you're starting it from the terminal when you're logged in, it'll cease to exist as soon as you reboot.

So, make sure you are starting sshd from the DAEMONS array in /etc/rc.conf.  That way it will load as soon as the system comes up...for example:

DAEMONS=(syslog-ng ... sshd)

Last edited by thayer (2008-07-07 09:33:05)


thayer williams ~ cinderwick.ca

Offline

#3 2008-07-07 08:33:45

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: sshd at bootup

It is already there.
ssh works fine after I log in.
It makes no sense to me


neutral

Offline

#4 2008-07-07 09:37:05

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: sshd at bootup

Sounds strange for sure...I've certainly never heard of that behaviour, but then again I don't know what your setup is.  Posting your /etc/rc.conf and possibly details of your environment (login manager, xinitrc, etc.) may help a bit, though honestly if you know for certain it is started automatically as soon as you log in then I don't have much more advice.

How are you connecting remotely? I mean, exactly what command are you running? ssh user@domain?


thayer williams ~ cinderwick.ca

Offline

#5 2008-07-07 21:33:32

Basu
Member
From: Cornell University
Registered: 2006-12-15
Posts: 292
Website

Re: sshd at bootup

You might get a problem if the system tries to start up sshd before setting up all the network stuff. I'm considering setting up an SSH server as well, so I'd like to see this issue fixed as well.


The Bytebaker -- Computer science is not a science and it's not about computers
Check out my open source software at Github

Offline

#6 2008-07-07 22:58:47

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: sshd at bootup

#
# /etc/rc.conf - Main Configuration for Arch Linux
#

# -----------------------------------------------------------------------
# LOCALIZATION
# -----------------------------------------------------------------------
#
# LOCALE: available languages can be listed with the 'locale -a' command
# HARDWARECLOCK: set to "UTC" or "localtime"
# USEDIRECTISA: use direct I/O requests instead of /dev/rtc for hwclock
# TIMEZONE: timezones are found in /usr/share/zoneinfo
# KEYMAP: keymaps are found in /usr/share/kbd/keymaps
# CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US)
# CONSOLEMAP: found in /usr/share/kbd/consoletrans
# USECOLOR: use ANSI color sequences in startup messages
#
LOCALE="en_US.utf8"
HARDWARECLOCK="localtime"
USEDIRECTISA="no"
TIMEZONE="Australia/Adelaide"
KEYMAP="us"
CONSOLEFONT=
CONSOLEMAP=
USECOLOR="yes"

# -----------------------------------------------------------------------
# HARDWARE
# -----------------------------------------------------------------------
#
# MOD_AUTOLOAD: Allow autoloading of modules at boot and when needed
# MOD_BLACKLIST: Prevent udev from loading these modules
# MODULES: Modules to load at boot-up. Prefix with a ! to blacklist.
#
# NOTE: Use of 'MOD_BLACKLIST' is deprecated. Please use ! in the MODULES array.
#
MOD_AUTOLOAD="yes"
#MOD_BLACKLIST=() #deprecated
MODULES=(atl1 mii iwl4965 !snd-hda-intel !snd-mixer-oss
!snd-pcm-oss
!snd-hwdep !snd-page-alloc !snd-pcm !snd-timer !snd-pcsp !snd !soundcore)

# Scan for LVM volume groups at startup, required if you use LVM
USELVM="no"

# -----------------------------------------------------------------------
# NETWORKING
# -----------------------------------------------------------------------
#
# HOSTNAME: Hostname of machine. Should also be put in /etc/hosts
#
HOSTNAME="tys-arch"

# Use 'ifconfig -a' or 'ls /sys/class/net/' to see all available interfaces.
#
# Interfaces to start at boot-up (in this order)
# Declare each interface then list in INTERFACES
#   - prefix an entry in INTERFACES with a ! to disable it
#   - no hyphens in your interface names - Bash doesn't like it
#
# DHCP:     Set your interface to "dhcp" (eth0="dhcp")
# Wireless: See network profiles below
#
eth0="dhcp"
wlan0="dhcp"
INTERFACES=(lo eth0 !wlan0)

# Routes to start at boot-up (in this order)
# Declare each route then list in ROUTES
#   - prefix an entry in ROUTES with a ! to disable it
#
gateway="default gw 192.168.1.254"
ROUTES=(!gateway)

# Enable these network profiles at boot-up.  These are only useful
# if you happen to need multiple network configurations (ie, laptop users)
#   - set to 'menu' to present a menu during boot-up (dialog package required)
#   - prefix an entry with a ! to disable it
#
# Network profiles are found in /etc/network.d
#
# This now requires the netcfg package
#
#NETWORKS=(main)

# -----------------------------------------------------------------------
# DAEMONS
# -----------------------------------------------------------------------
#
# Daemons to start at boot-up (in this order)
#   - prefix a daemon with a ! to disable it
#   - prefix a daemon with a @ to start it up in the background
#
DAEMONS=(syslog-ng @network @sshd netfs acpid laptop-mode @hal dhcdbd oss-linux-free networkmanager @fam crond slim)

I tried disabling slim altogether but that made no difference.
[edit]
.xinitrc is empty apart from
exec openbox-session

Last edited by sand_man (2008-07-07 23:03:06)


neutral

Offline

#7 2008-07-07 23:44:43

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: sshd at bootup

sand_man wrote:
DAEMONS=(syslog-ng @network @sshd netfs acpid laptop-mode @hal dhcdbd oss-linux-free networkmanager @fam crond slim)

I would have to agree with Basu.  Although it's never presented a problem for my own setup, but it could be that sshd is failing because it's starting before network is...err wait a sec.  You've got networkmanager/dhcdbd enabled with @network--you shouldn't need both. That might be causing a conflict, I'm not sure.  And try moving @sshd to the end of your list. The order shouldn't matter since it's backgrounded, but hey, ya never know!


thayer williams ~ cinderwick.ca

Offline

#8 2008-07-08 02:15:40

Pudge
Arch Linux f@h Team Member
Registered: 2006-01-23
Posts: 298

Re: sshd at bootup

sand_man wrote:
DAEMONS=(syslog-ng @network @sshd netfs acpid laptop-mode @hal dhcdbd oss-linux-free networkmanager @fam crond slim)

In just about every tutorial, guide, Wiki, etc I have read, they state that network and netfs need to be started before sshd.  I haven't any experience with networkmanager, but I agree with thayer, put sshd after network, netfs, and networkmanager.

The Arch Wiki on ssh used to state this also, but it now simply states "Just add sshd to the "DAEMONS" section of your /etc/rc.conf:"  If this fixes your problem, then maybe you should edit the SSH entry in the Wiki.

Pudge

Offline

#9 2008-07-22 04:36:46

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: sshd at bootup

Sorry to bump an old thread but I just thought I would mention that I know what the issue is here.
It is because wlan0 does not connect until I login as my local account (and startx) because I use nm-applet to connect to my router.


neutral

Offline

Board footer

Powered by FluxBB