You are not logged in.

#1 2013-12-08 16:29:23

sabrefresco
Member
Registered: 2013-12-08
Posts: 2

[SOLVED]Starting SSH before logging in

I am currently hosting Arch on VirtualBox and I plan to use it remotely via SSH. I installed openssh, changed the ports to my liking and can access it (via my WAN IP) while I am logged in through VirtualBox. I have also use the following to command

systemctl enable sshd.service

to enable SSH at startup. But I cannot SSH into my Arch server after a reboot. It only works after logging in (via VirtualBox) and at times only after using the the following command

systemctl restart sshd.service

.
How can I start the SSH service before logging in as I will be needing to remotely restart and use it in the future?

Update: It seems that now I cannot connect even after using the "systemctl restart sshd.service" command. Below is the output for "systemctl status sshd.service"

http://i.imgur.com/NRTmURH.png

Update 2: My bad, I forgot to put a static IP for my Arch set-up. Very stupid indeed sad




-- mod edit: read the Forum Etiquette and only post thumbnails http://wiki.archlinux.org/index.php/For … s_and_Code [jwr] --

Last edited by sabrefresco (2013-12-08 16:58:07)

Offline

#2 2013-12-08 16:41:39

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,600
Website

Re: [SOLVED]Starting SSH before logging in

Just a wild guess but are you attempting to connect on port 24, ie

ssh -p 24 user@boxname

A 2nd wild guess, do you have a firewall configured on the vbox that has not allowed ssh traffic on port 24?

Last edited by graysky (2013-12-08 16:42:09)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2013-12-08 16:44:49

nd7rmn8
Member
Registered: 2013-12-08
Posts: 9

Re: [SOLVED]Starting SSH before logging in

is its network connection enabled?

netctl start nameofnetworkprofile


i just cant stop thinking about how much smarter id be if i would have started reading years ago instead of skimming to find the answer...

tl;dr, meh

Offline

#4 2013-12-08 16:48:47

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,600
Website

Re: [SOLVED]Starting SSH before logging in

@nd - sshd.service requires a network so it should be...

% grep -i after /usr/lib/systemd/system/sshd.service 
After=sshdgenkeys.service
After=network.target

CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#5 2013-12-08 16:48:48

sabrefresco
Member
Registered: 2013-12-08
Posts: 2

Re: [SOLVED]Starting SSH before logging in

nd7rmn8 wrote:

is its network connection enabled?

netctl start nameofnetworkprofile

graysky wrote:

Just a wild guess but are you attempting to connect on port 24, ie

ssh -p 24 user@boxname

A 2nd wild guess, do you have a firewall configured on the vbox that has not allowed ssh traffic on port 24?

I forgot to put the Virtual Machine on a static IP. My bad, it all works now smile

Last edited by sabrefresco (2013-12-08 16:49:59)

Offline

#6 2013-12-08 17:06:35

nd7rmn8
Member
Registered: 2013-12-08
Posts: 9

Re: [SOLVED]Starting SSH before logging in

glad to hear its working.

graysky wrote:

@nd - sshd.service requires a network so it should be...

% grep -i after /usr/lib/systemd/system/sshd.service 
After=sshdgenkeys.service
After=network.target

actually, on mine, sshd starts on boot, but i still have to manually type "netctl start networkprofile" on each bootup before i can connect to the internet.   I can however ssh into 127.0.0.1 beforehand, so I guess loopback qualifies as enough of a network for sshd to start.


i just cant stop thinking about how much smarter id be if i would have started reading years ago instead of skimming to find the answer...

tl;dr, meh

Offline

#7 2013-12-08 22:09:34

bulletmark
Member
From: Brisbane, Australia
Registered: 2013-10-22
Posts: 658

Re: [SOLVED]Starting SSH before logging in

Why would you change the port away from the default (22) when you are accessing it via your WAN anyhow? Why not just forward your public WAN port (whatever you desire that to be) to port 22 on your VB server?

Last edited by bulletmark (2013-12-08 22:10:22)

Offline

Board footer

Powered by FluxBB