Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

I have a beaglebone black and I used scp to transfer a file from my desktop to the beaglebone today. The beaglebone came from adafruit with debian pre-installed.

I sent it as root user, like: scp ./foo root@192.168.1.72:/home/debian/

I meant to do it as the default debian user, but wasn't thinking.
So anyways when I ran this command it didn't ask me for a password and just wrote the file as root for me. WTF?

e: i know there's some way to set up SSH keys or something so that you don't get prompted for pw, but I always forget how this works, and I'm pretty sure I never set this device up for that, sooo...

peepsalot fucked around with this message at 03:49 on Dec 20, 2016

Adbot
ADBOT LOVES YOU

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

Storysmith posted:

Try running (as root)
code:
cat /root/.ssh/authorized_keys
code:
cat: /root/.ssh/authorized_keys: No such file or directory
there is no .ssh dir under /root at all

Storysmith posted:

Adding more levels of -v flags to get more debug output will shine some light as to how auth (if any) is happening.
code:
peeps@peeps-ThinkPad-W510:~$ touch foo
peeps@peeps-ThinkPad-W510:~$ scp -v foo root@192.168.1.72:/home/debian/
Executing: program /usr/bin/ssh host 192.168.1.72, user root, command scp -v -t /home/debian/
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 *
debug1: Connecting to 192.168.1.72 [192.168.1.72] port 22.
debug1: Connection established.
debug1: identity file /home/peeps/.ssh/id_rsa type 1
debug1: identity file /home/peeps/.ssh/id_rsa-cert type -1
debug1: identity file /home/peeps/.ssh/id_dsa type -1
debug1: identity file /home/peeps/.ssh/id_dsa-cert type -1
debug1: identity file /home/peeps/.ssh/id_ecdsa type -1
debug1: identity file /home/peeps/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/peeps/.ssh/id_ed25519 type -1
debug1: identity file /home/peeps/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.0p1 Debian-4+deb7u6
debug1: match: OpenSSH_6.0p1 Debian-4+deb7u6 pat OpenSSH* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA 74:4c:b9:73:85:62:82:f9:c7:17:5d:9f:72:b1:e9:8f
debug1: Host '192.168.1.72' is known and matches the ECDSA host key.
debug1: Found key in /home/peeps/.ssh/known_hosts:31
debug1: ssh_ecdsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
Debian GNU/Linux 7

BeagleBoard.org Debian Image 2015-11-12

Support/FAQ: [url]http://elinux.org/Beagleboard:BeagleBoneBlack_Debian[/url]

default username:password is [debian:temppwd]

debug1: Authentication succeeded (none).
Authenticated to 192.168.1.72 ([192.168.1.72]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email]no-more-sessions@openssh.com[/email]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LC_PAPER = en_US.UTF-8
debug1: Sending env LC_ADDRESS = en_US.UTF-8
debug1: Sending env LC_MONETARY = en_US.UTF-8
debug1: Sending env LC_NUMERIC = en_US.UTF-8
debug1: Sending env LC_TELEPHONE = en_US.UTF-8
debug1: Sending env LC_IDENTIFICATION = en_US.UTF-8
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending env LC_MEASUREMENT = en_US.UTF-8
debug1: Sending env LC_TIME = en_US.UTF-8
debug1: Sending env LC_NAME = en_US.UTF-8
debug1: Sending command: scp -v -t /home/debian/
Sending file modes: C0644 0 foo
Sink: C0644 0 foo
foo                                                                                                                                         100%    0     0.0KB/s   00:00
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
Transferred: sent 3040, received 1856 bytes, in 0.1 seconds
Bytes per second: sent 34492.5, received 21058.6
debug1: Exit status 0

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

Storysmith posted:

Well there's your answer. Apparently out of the box, it doesn't require auth for root access for some reason. I'll need to see if I still have my BBB to play with, but that's hilarious.
Ok well i just spent an inordinate amount of time looking into this for reasons I can't quite explain, but it looks like the issue is a combination of things

First I found that root password is blank ( /etc/shadow shows root:: )
Is this typical for debian based systems that use sudo to escalate privileges anyways?

But when you combine that empty password with these settings in /etc/ssh/sshd_config
PermitRootLogin yes
and
PermitEmptyPasswords yes

Then it just lets you ssh with no password. I found that changing just the PermitEmptyPasswords option to no is enough to stop this behavior.

I guess I'm just curious if this sort of blank root password setup could cause other security issues outside of ssh/scp.
And just still generally confused about how this whole sudo situation with no actual root password is *supposed* to work in a secure manner.

peepsalot fucked around with this message at 02:31 on Dec 22, 2016

  • Locked thread