marinebon / sdg14

Products for Sustainable Development Goal 14 on Life in the Sea
http://marinebon.github.io/sdg14
3 stars 0 forks source link

can't log in to rstudio #23

Closed 7yl4r closed 7 years ago

7yl4r commented 7 years ago

I had some spare time today and wanted to (finally) log into rstudio and poke around a bit, but found that I couldn't get in.

image

I poked around a bit on the server to see if I could troubleshoot it, but had no luck. Is Rstudio running on the VM directly or within one of the docker containers? Maybe within rstudio-shiny... but I thought the shiny container was separate?

tylarmurray@mbon:~$ sudo docker container list 
CONTAINER ID        IMAGE                                   COMMAND                  CREATED             STATUS              PORTS                                            NAMES
4b5303165a56        bdbest/rstudio-shiny:R-3.4-geospatial   "/init"                  3 days ago          Up 3 days           0.0.0.0:3838->3838/tcp, 0.0.0.0:8787->8787/tcp   rstudio-shiny
5c54dfebd408        nginx                                   "nginx -g 'daemon ..."   2 weeks ago         Up 6 days           0.0.0.0:80->80/tcp                               www
719e5ca7cd7b        kartoza/geoserver                       "catalina.sh run"        2 weeks ago         Up 6 days           0.0.0.0:8080->8080/tcp                           geoserver
426f948c56b3        kartoza/postgis                         "/bin/sh -c /start..."   2 weeks ago         Up 6 days           0.0.0.0:5432->5432/tcp                           postgis
bbest commented 7 years ago

Hi Tyler,

I manually added users to mbon and the rstudio-shiny (yes, now combined so geospatial libraries available to shiny) so got wiped when reinstalled docker. Trying to use newusers to create update easily.

Related issues:

7yl4r commented 7 years ago

It's a bit verbose, but I guess you could do it manually for the users you want right?

mkdir migrate_usr
cd migrate_usr
for usr in ('tylarmurray' 'otheruser' 'otherotheruser') do 
    grep $usr /etc/passwd >> passwd
    grep $usr /etc/group >> group
    grep $usr /etc/shadow >> shadow
    grep $usr /etc/gshadow >> gshadow
done

then move it to the container scp migrate_usr ben@docker_container:., make back ups just in case and then append stuff in the container

mkdir newsusers.bak
cp /etc/passwd /etc/shadow /etc/group /etc/gshadow newsusers.bak

cd migrate_usr
cat passwd >> /etc/passwd
cat group >> /etc/group
cat shadow >> /etc/shadow
cat gshadow >> /etc/gshadow

Or do you want logins to be synced across the docker host and container? I might be able to hook mbon and the shiny container into our LDAP server, but maybe that is overkill on this.

bbest commented 7 years ago

Hi Tylar,

Thanks for these! I don't follow scp migrate_usr ben@docker_container:.. Since the /mbon volume is shared by the server mbon and all the docker containers, I just used the same R script to iterate through a users.txt file to use with newusers, which you can see at /mbon/admin/add_users.R and run with:

sudo Rscript /mbon/admin/add_users.R; cat /etc/passwd

Because of Bug #1266675 “newusers error adding more than one user” : shadow package : Ubuntu, I had to iterate per user but could at least feed the password without prompting.

You should be able to login again to http://mbon.marine.usf.edu:8787 as tylarmurray

7yl4r commented 7 years ago

Nice! Docker is still a bit mysterious to me.

I'll test this out Monday. Thanks!

On Fri, Jul 28, 2017, 7:26 PM Ben Best notifications@github.com wrote:

Closed #23 https://github.com/marinebon/sdg14/issues/23.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/marinebon/sdg14/issues/23#event-1184315727, or mute the thread https://github.com/notifications/unsubscribe-auth/ABAK_uNK4yHzUIlhCb7LiSMV6JxSt-N5ks5sSm4XgaJpZM4Omu_T .

7yl4r commented 7 years ago

hmm. Can't log into rstudio

image

...but... also can't ssh into the mbon server anymore

me@local:~$ ssh tylarmurray@mbon
tylarmurray@mbon's password: 
Permission denied, please try again.
bbest commented 7 years ago

Hi @7yl4r,

Just sent you the password I used for your account on both mbon server and rstudio-shiny docker.

7yl4r commented 7 years ago

thanks! :+1: