SSH into Odroid XU4

Post Reply
automaton
Posts: 3
Joined: Sun Apr 21, 2019 8:06 am
languages_spoken: english
ODROIDs: XU4
Has thanked: 1 time
Been thanked: 0
Contact:

SSH into Odroid XU4

Unread post by automaton » Sun Apr 21, 2019 8:35 am

Hi all,

I'm new to the forum! I'm not currently able to ssh into my odroid and haven't been able to find a solution based on existing threads.

I just got started with my Odroid XU4 running 18.04. I've interfaced with a number of Linux VMs in the past, but haven't messed with administration and general server setup before.

My odroid is connected to to the same wifi network as my machine that I'm trying to ssh from. I got the IP address of the odroid by running

Code: Select all

 curl ifconfig.me 
from the CLI. When I do either

Code: Select all

 ssh odroid@xxx.xxx.xxx.xxx 
or

Code: Select all

 ssh root@... 
I get "Permission denied (publickey,password)". Now I've seen this in MANY threads, but I haven't found a solution that works for me.

Here's what I've done:
1) I changed the PermitRootLogin in /etc/ssh/sshd_config to yes. Here is my sshd_config file.

Code: Select all

 #	$OpenBSD: sshd_config,v 1.101 2017/03/14 07:19:07 djm Exp $

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options override the
# default value.

#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key

# Ciphers and keying
#RekeyLimit default none

# Logging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

PubkeyAuthentication yes

# Expect .ssh/authorized_keys2 to be disregarded by default in future.
AuthorizedKeysFile	/home/odroid/.ssh/authorized_keys

#AuthorizedPrincipalsFile none

#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication no
#PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange no

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes

#	$OpenBSD: sshd_config,v 1.101 2017/03/14 07:19:07 djm Exp $

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options override the
# default value.

#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key

# Ciphers and keying
#RekeyLimit default none

# Logging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

PubkeyAuthentication yes

# Expect .ssh/authorized_keys2 to be disregarded by default in future.
AuthorizedKeysFile	/home/odroid/.ssh/authorized_keys

#AuthorizedPrincipalsFile none

#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication no
#PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange no

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes

#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
PrintMotd no
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none

# no default banner path
#Banner none

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

# override default of no subsystems
Subsystem	sftp	/usr/lib/openssh/sftp-server

# Example of overriding settings on a per-user basis
#Match User anoncvs
#	X11Forwarding no
#	AllowTcpForwarding no
#	PermitTTY no
#	ForceCommand cvs server 
2) I've also messed around with the AuthorizedKeysFile directory as I added my laptop's public id_rsa to ~/.ssh/authorized_keys but that didn't solve it either.
3) A slightly different approach I've taken is setting up the an AP from the Odroid using create_ap but that wasn't a fruitful path either (I can elaborate more on this if this is something I should be doing).

My hardware setup is that I have two wifi dongles attached to the Odroid currently. One will access the internet generally and the other will create an AP so that I can ssh in even when there isn't an existing network that my Odroid has credentials for.

Thanks!

User avatar
meveric
Posts: 10452
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2
Has thanked: 16 times
Been thanked: 127 times
Contact:

Re: SSH into Odroid XU4

Unread post by meveric » Sun Apr 21, 2019 8:38 am

automaton wrote:
Sun Apr 21, 2019 8:35 am
2) I've also messed around with the AuthorizedKeysFile directory as I added my laptop's public id_rsa to ~/.ssh/authorized_keys but that didn't solve it either.
I hope you meant "id_rsa.pub" as the other is the "private key" which should never be "shared".
Only if you add the public key it will work.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

automaton
Posts: 3
Joined: Sun Apr 21, 2019 8:06 am
languages_spoken: english
ODROIDs: XU4
Has thanked: 1 time
Been thanked: 0
Contact:

Re: SSH into Odroid XU4

Unread post by automaton » Sun Apr 21, 2019 10:07 am

Yes .pub. I should have been precise!

User avatar
mad_ady
Posts: 6545
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 168 times
Been thanked: 128 times
Contact:

Re: SSH into Odroid XU4

Unread post by mad_ady » Sun Apr 21, 2019 3:09 pm

curl ifconfig.me returns your network's public address. Chances are your lan is behind NAT so the public ip you're seeing is your router's. Try with your router credentials to test.
To find out your odroid's private ip run ip addr show in it's shell.
These users thanked the author mad_ady for the post:
automaton (Mon Apr 22, 2019 9:56 am)

automaton
Posts: 3
Joined: Sun Apr 21, 2019 8:06 am
languages_spoken: english
ODROIDs: XU4
Has thanked: 1 time
Been thanked: 0
Contact:

Re: SSH into Odroid XU4

Unread post by automaton » Mon Apr 22, 2019 9:59 am

Thanks for the pointer. That in conjunction with some incorrect lines in my sshd_config resolved it!

As a follow up, my understanding is that I need to have two antenna if I want to create an AP (for when I don't have a monitor or a known network for my odroid). Do I basically create a startup bash script so that an AP is created on boot and then if I switch to that lan on another machine, I can ssh in? Or what's the canonical solution?

joshua.yang
Posts: 243
Joined: Fri Sep 22, 2017 5:54 pm
languages_spoken: Korean, English
ODROIDs: XU4, XU4Q + Cloudshell2, H2, N2
Has thanked: 2 times
Been thanked: 24 times
Contact:

Re: SSH into Odroid XU4

Unread post by joshua.yang » Mon Apr 22, 2019 11:37 am

I'm not sure AP mode can be as SSH access point.

Just to monitor your device, you can connect to that using SSH to the only private IP address the device has, which is shown 192.168.0.x usually.

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 1 guest