How to create credentials for Jupyterhub? - bluedata

I have provisioned a Spark 2.3.1 notebooks & Jupyterhub with SSL & centos7x cluster on BlueData.
When I access the Jupyerhub service, I am prompted for a username and password:
My BlueData Tenant:
is NOT configured for LDAP/AD
has Cluster Superuser Privilege set to Site Admin and Tenant Member/Admin
How can I generate a static username/password credentials for accessing Jupyterhub?

First login to the tenant and then navigate to the clusters screen.
Click the link to download the Tenant KeyPair:
Now, click on the link for the cluster (in my example this is 'test'):
You can retrieve the jupyterhub ssh hostname and port. Remember to change the hostname to the gateway hostname. You can now ssh into the cluster:
ssh bluedata#your_gw_host -p your_port -i /downloaded/tenant/keypair.pem
You can add a user as follows:
sudo useradd your_username
# set the password for your_username
sudo passwd your_username
You can now login to Jupyterhub with those credentials.

Related

My Airflow does not connect to localhost 8080, But it is runing on docker

It is asking for authentication, but My authentication keys are set to False
The username and password was admin, admin. It is resolved

Docker context over SSH with different user

Is there any way to set up a docker context such that I can execute docker commands as another user on a remote box? I have a setup such that I ssh to a remote box as my own username, then interact once on that box with docker using a separate user which is in the docker group (with sudo -u userNameHere).
I'm hoping to be able to use docker contexts to deploy stuff on the box without having to SSH in directly, however it seems like this additional user step may make that impossible. Is there a way to do this, or am I stuck SSHing in for now?
You can modify ~/.ssh/config so you always connect to some host(s) as a different user:
Host example.com *.example.com
HostName example.com
IdentityFile ~/.ssh/id_rsa
User admin
The above will make your ssh client to connect to example.com or any server that match *.example.com (server1.example.com for instance) as a user admin.

Using local accounts in windows docker container to access machines on the same network

I have a Windows machine, machine 1 on a network with a local account called testlocal.
I have another machine, machine 2 on the network with the same local account, testlocal.
From my machine 1, I am able to access a folder with share enabled to testlocal because I have the same testlocal username and password on both machines as local accounts.
Now, when i build a docker container on machine 1. I see that I can ping machine 2. I can even call:
net use \\machine2 <password> /USER:machine2\testlocal
And gain access to the shared drive.
But, when I do the following in my dockerfile on machine1:
RUN net user testlocal <password> /ADD /EXPIRES:NEVER
RUN net LOCALGROUP Administrators /ADD testlocal
And then cmd into the container on machine1 to test, it says the password is incorrect when running:
net view \\machine2 /USER:testlocal
After the above command fails it prompts for a password, I then enter the password (the exact same password that i specify in my dockerfile) and it works.
My goal is to have an entry point in my container that allows user to enter the credentials for the common local account, and then let the application running in the container to access those shared drives without a username and password.
What is the proper way to gain access to windows shares?
Is this approach reasonable?
Ended up ensuring the application running would set up the network shares on initialization. Must perform a system call:
NET use \\\\<sharePath> <password> /USER:<user> /PERSISTENT:YES"
This seems to work.

How do i get docker registry username and password in gitlab.com?

I want to login to docker registry in gitlab.com using ansible play, but how do i get docker registry username and password in gitlab?
Is it same as gitlab.com username and password?
Registry credentials in GitLab are the same as the repositories they belong to. So, you can use your GitLab.com username and password.
That said, you should probably create a personal access token with only read_registry permissions to use with Ansible, instead of literally using your account credentials, to limit what Ansible can do. And, you can revoke the token if it leaks.
Documentation: Personal access tokens

how to replace the default ssh key to get access to docker-machine

I am using docker-machine to create a develop environment. I want to change the docker-machine default ssh key.
I check the config of my new machine:
docker-machine config develop
--tlsverify --tlscacert="/Users/robe/.docker/machine/machines/develop/ca.pem" --tlscert="/Users/robe/.docker/machine/machines/develop/cert.pem" --tlskey="/Users/robe/.docker/machine/machines/develop/key.pem" -H=tcp://192.168.99.103:2376
when I try to access using the key:
--tlskey="/Users/robe/.docker/machine/machines/develop/key.pem"
With this command:
ssh -i /Users/robe/.docker/machine/machines/develop/key.pem docker#192.168.99.103
Then I got the prompt to write password. So Why I can't access to my virtual machine using this access key.
Do I need to do any other configuration?
Is possible to specify a new key?
What is the docker user password to get access using ssh key connection?
Any help please?
The key you're attempting to use is an SSL key used to protect the SSL connection to the remote docker agent. It is not an SSH key (different format).
SSH keys are generated for each machine created. Try the following command to obtain ssh access:
docker-machine ssh development
A more convoluted solution would be:
ssh -i ~/.docker/machine/machines/development/id_rsa docker#$(docker-machine ip development)

Resources