SSH Key Upload?

Game development with Board Game Arena Studio
User avatar
Swandog
Posts: 6
Joined: 18 April 2020, 19:14

SSH Key Upload?

Post by Swandog »

Hi there! I'm just going through the Studio setup and Hearts tutorial, and I wanted to upload an SSH key to use for authentication through sftp; but I couldn't find a way to do that. Is that not allowed?
User avatar
Victoria_La
Posts: 665
Joined: 28 December 2015, 20:55

Re: SSH Key Upload?

Post by Victoria_La »

What specifically does not work? You cannot create .ssh folder or get permission issues when uploading?
User avatar
Draasill
Posts: 197
Joined: 26 April 2020, 00:00

Re: SSH Key Upload?

Post by Draasill »

That's the first thing I tried, and indeed it's not permitted.

Tried with ssh-copy-id, then manually, IIRC creation of the .ssh directory is forbidden.
User avatar
Lymon Flowers
Posts: 194
Joined: 01 April 2020, 21:14

Re: SSH Key Upload?

Post by Lymon Flowers »

You can still do the following if you are using GNU/Linux :

Code: Select all

lftp -e "cd gamename ; put $files ; mirror -R img ; cd modules ; lcd modules ; mput *php ; quit" sftp://user:passwd.studio.boardgamearena.com 
Of any variation.

Also, you may consider using sshpass instead of lftp.
User avatar
Een
Posts: 3861
Joined: 16 June 2010, 19:52

Re: SSH Key Upload?

Post by Een »

I confirm that as most sftp access utils allow to store the password, we haven't had many requests for this (it's only the second request that I remember) and haven't made it a priority to provide a way to upload keys in the studio.
User avatar
Draasill
Posts: 197
Joined: 26 April 2020, 00:00

Re: SSH Key Upload?

Post by Draasill »

I personnaly use :

Code: Select all

echo [password] | sshfs [user]@1.studio.boardgamearena.com:[gamepath] /home/user/mountpoint -o password_stdin
And to sync :

Code: Select all

rsync -c --delete -rzpP --exclude=.git /home/user/src/ /home/user/mountpoint/
And I even wrap this in a "inotify" loop to auto sync the code :

Code: Select all

while true; do inotifywait --exclude .git -e CLOSE_WRITE -r /home/user/src; sleep 1; rsync -c --delete -rzpP --exclude=.git /home/user/src/ /home/user/mountpoint/; done
User avatar
purge
Posts: 2
Joined: 16 January 2012, 07:27

Re: SSH Key Upload?

Post by purge »

Een wrote: 29 May 2020, 16:03 (it's only the second request that I remember)
I'll be number 3, then. Uploading a key would be the most helpful option for me.
User avatar
Matthijs Kooijman
Posts: 2
Joined: 26 April 2020, 18:44

Re: SSH Key Upload?

Post by Matthijs Kooijman »

I would also consider this helpful. I often use commandline tools, which often don't save passwords and don't allow specifying them non-interactively. (then again, I'm not an active developer on GBA, at least not yet, so count my request lightly)
User avatar
Elliot K
Posts: 11
Joined: 26 August 2020, 23:15

Re: SSH Key Upload?

Post by Elliot K »

I'd also appreciate this feature.

You're already creating our home directories with some dotfiles that are owned by our user: .bashrc, .profile, .bash_logout. It should be fairly simple to add a .ssh directory to /etc/skel or whatever template you use for home directories. For security, though, you probably want to create .ssh as owned by 0:0 and .ssh/authorized_keys owned by the user. And people can specify extra options in authorized_keys, too, which may have security implications (see http://man.he.net/man5/authorized_keys). Maybe it's not so simple...
User avatar
mavit
Posts: 36
Joined: 15 September 2016, 20:20

Re: SSH Key Upload?

Post by mavit »

Elliot K wrote: 05 October 2020, 22:26 And people can specify extra options in authorized_keys, too, which may have security implications (see http://man.he.net/man5/authorized_keys). Maybe it's not so simple...
I think all of these options tighten things that would otherwise be relaxed, but even so, it's probably best not to allow direct access to this file. Better to add a field for this to the Studio control panel which writes the `authorized_keys` file with the `restrict` option.
Post Reply

Return to “Developers”