Ssh access to MIAB user-data

I thought I would post here first since there may be something unique about the system.

What’s driving this is my desire to to be able to sftp into the user-data account from the dolphin file manager, meaning I don’t have to ssh in from my user account, su user-data so I can edit the files in /home/user-data/www/default. This works fine for my user account steve, connecting to many servers.

When I execute this command ssh example.com from my local desktop account user-data, I’m getting this error:

[user-data@T480 ~]$ ssh example.com 
user-data@example.com: Permission denied (publickey).

The only example.com /var/log/auth.log line for the attempt look like this:

Sep 19 16:05:04 box sshd[4273]: Connection closed by authenticating user user-data 74.124.xxx.xxx port 8889 [preauth]
...

My takeaway is the connection is somehow disconnected by the user user-data.

Background:

FWIW, my local environment is Arch Linux, KDE Plasma, using Konsole and Dolphin.

As is my usual practice, I share my ~/.ssh directory to my other local desktop accounts, so in this case copied /home/steve/.ssh to /home/user-data/.ssh, setting permissions correctly. So, user-data has the same keys that my working desktop user steve has.

The example.com /etc/ssh/sshd_config has these key lines set:

Include /etc/ssh/sshd_config.d/*.conf
PermitRootLogin no
AllowUsers steve user-data
PubkeyAuthentication yes
PasswordAuthentication no
PermitEmptyPasswords no
KbdInteractiveAuthentication no
UsePAM yes
X11Forwarding yes
PrintMotd no
AcceptEnv LANG LC_*
Subsystem       sftp    /usr/lib/openssh/sftp-server

As you can see, I added my user user-data to the AllowUsers line, and restarted sshd.

Any ideas for how to allow my local user-data account to connect to my MIAB server?

Thank you in advance.
Steve.

Update: Discovered that ssh user-data@example.com won’t even work without using keys! So, the keys may have nothing to do with this! However, from the user-data desktop account, I can do ssh steve@example.com just effing fine, so keys are fine. WTH.

I always use ssh -v to increase the verbosity of ssh. That usually gives the right clue for me to solve ssh issues. You can go up to ssh -vvv.

1 Like

Thanks for that. I should have tried it before. It errored out on publickey for some reason.

I just started over. Deleted the authorized_keys file on the server, and re-issued the ssh-copyid from the local account. That seemed to do the trick, so I can login. I don’t understand, but now it works. :slight_smile: So happy now.

Thanks to all.

Steve.

This topic was automatically closed 40 days after the last reply. New replies are no longer allowed.