[SOLVED] Fresh Install can't SSH. ssh_connect: needpriv 0

Ask questions about Arch Linux ARM. Please search before making a new topic.

[SOLVED] Fresh Install can't SSH. ssh_connect: needpriv 0

Postby jhillard314 » Thu Aug 27, 2015 10:27 pm

Relatively new to Arch, so bear with me as I stumble through this. This morning I was SSHing into my Raspberry PI 2 with Arch installed. For various reasons, I performed a clean install following the handy instructions here:http://archlinuxarm.org/platforms/armv7/broadcom/raspberry-pi-2 and booted successfully.
And now, I can't SSH into the PI. Plugging it into the router gives me a local IP, which I can ping successfully, but cannot ssh in. I get a Connection Refused error, and when I run with verbosity I find an error of ssh_connect: needpriv 0.
$this->bbcode_second_pass_code('', ' jake@Engineer3 ~ $ ping 10.0.0.18
PING 10.0.0.18 (10.0.0.18) 56(84) bytes of data.
64 bytes from 10.0.0.18: icmp_seq=1 ttl=64 time=3.36 ms
64 bytes from 10.0.0.18: icmp_seq=2 ttl=64 time=1.77 ms
^C
--- 10.0.0.18 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 1.773/2.567/3.362/0.796 ms
jake@Engineer3 ~ $ ssh -vv root@10.0.0.18
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 10.0.0.18 [10.0.0.18] port 22.
debug1: connect to address 10.0.0.18 port 22: Connection refused
ssh: connect to host 10.0.0.18 port 22: Connection refused')
So I pulled up /etc/ssh/sshd_config and changed these lines (the best I could find as a solution on other sources on the internet):
$this->bbcode_second_pass_code('', ' PermitRootLogin yes
PasswordAuthentication yes
PermitEmptyPasswords yes')
I want to be able just SSH in with the typical root/root user/pass. Security doesn't matter as it'll only be running locally with no ports forwarded.
And one more thing, I can't gain access to the internet and use a monitor all at once. I have to either operate headerless and connected to my router, or move into the other room with an hdmi television to make any changes. So I've been running back and forth all morning testing and swapping rooms. I can't really install any new software (like dialog for wireless) without first gaining access to my PI. So this SSH has become pretty important
Can you help me get back into my machine? Any help you have would be greatly appreciated, this has been a hell of a morning.

Edit, had a similiar problem to what it sounds like lots of people are having when they update pacman -Syu. But I already changed the PermitRootLogin to yes, so I can't figure out what else to do
Last edited by jhillard314 on Thu Aug 27, 2015 11:04 pm, edited 1 time in total.
jhillard314
 
Posts: 3
Joined: Thu Aug 27, 2015 10:21 pm

Re: Fresh Install can't SSH. ssh_connect: needpriv 0

Postby WarheadsSE » Thu Aug 27, 2015 10:33 pm

If you can't get sshd to respond on the traditional port: I would hook it up to serial and/or monitor and inspect the journal from the fresh boot. Certainly, sshd should be telling you something. I immediately think that maybe the host keys generation had an issue.

Also, in new installs, as I am sure you read on the installation instructions, there is not root access to ssh out of the box.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: Fresh Install can't SSH. ssh_connect: needpriv 0

Postby jhillard314 » Thu Aug 27, 2015 10:49 pm

Thanks. a quick call of journalctl -u sshd |tail -100 seems to support your idea about the host key generation.
I can't copy and paste, but it just repeated a few lines over and over;
$this->bbcode_second_pass_code('', '
key_load_public: invalid format
Could not load host key: /etc/ssh/ssh_host_dsa_key
...
...(other dirs to other keys)
...
sshd: no hostkeys available -- exiting. ')
How can I go about fixing my key generation?

As far as root access out of the box, the modification to sshd_config: PermitRootLogin yes should be enough for that correct?
edit; readability
Last edited by jhillard314 on Thu Aug 27, 2015 11:12 pm, edited 1 time in total.
jhillard314
 
Posts: 3
Joined: Thu Aug 27, 2015 10:21 pm

Re: Fresh Install can't SSH. ssh_connect: needpriv 0

Postby WarheadsSE » Thu Aug 27, 2015 10:54 pm

delete all keys.

systemctl start sshdgenkeys.service
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: Fresh Install can't SSH. ssh_connect: needpriv 0

Postby jhillard314 » Thu Aug 27, 2015 11:03 pm

Thank you so much!
Before I got your response I called rm ssh_host* and rebooted the system.
Checking the journal says that sshd successfully started, and now I am able to login.

For the sake of completeness, my other computer (that I'm sshing from) threw a "WARNING: REMOTE HOST IDENTIFICATION CHANGED" because I've logged in on the ip before. To fix that I called ssh-keygen -f "/home/myUserName/.ssh/known_hosts" -R 10.0.0.18 and then it let me ssh no problem.

I don't think I ever would have checked the journals. That's a tip I'll have to file away for later. Thanks again!
edit: tagged as solved
jhillard314
 
Posts: 3
Joined: Thu Aug 27, 2015 10:21 pm

Re: [SOLVED] Fresh Install can't SSH. ssh_connect: needpriv

Postby WarheadsSE » Fri Aug 28, 2015 12:45 pm

When in doubt, check the logs :ugeek:
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm


Return to User Questions

Who is online

Users browsing this forum: No registered users and 4 guests