question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Granting users admin permissions on their container

See original GitHub issue

How do you give users permission to install packages on their server?

Specifically I am trying to connect to mssql, as part of this I need to install freetds

Here are the two paths I go down:

$ apt-get install freetds
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

So I try it with sudo

$ sudo apt-get install freetds

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

[sudo] password for jovyan:

and I don’t know the password for jovyan.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

8reactions
parentecommented, Jan 5, 2018

At the CLI, you need to add --user root. For example, @nazeels command would become:

For example, @nazeels docker run -ti --rm --user root -p 8888:8888 -e GRANT_SUDO=yes jupyter/datascience-notebook:2c80cf3537ca start-notebook.sh

The container needs to start as root in order to add the otherwise unprivileged jovyan user the sudoers file. Once it does that, it the startup script becomes the jovyan user before launching the notebook server. (https://github.com/jupyter/docker-stacks/tree/master/datascience-notebook#docker-options in the -e GRANT_SUDO=yes bullet)

@minrk I’m not sure how to tell JupyterHub to launch the image as the root user to start (or if that’s even possible via config) other than to do what @kjschiroo suggested and build a custom image that always defaults to running as root.

5reactions
kjschiroocommented, Jul 21, 2017

The way that I got around this was creating a new container image with a docker file like this:

FROM jupyter/datascience-notebook
USER root

Then I would set c.DockerSpawner.container_image to the name of the new container.

I think this introduces security concerns in some situations. In my case I was using it with only trusted users and within a private networks so the risks were acceptable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to give a domain user admin permissions to their laptop
In the right pane, double click Administrators. In the Select Users dialog, click Advanced. Click Find Now.
Read more >
Grant Container-Group Administrator Privileges to a User
Container-group administrator privileges can be granted to another user at any time. Context. Each container group can have its own set of administrators....
Read more >
How to Grant User Access to Google Tag Manager
To grant access to your Google Tag Manager container, select User Management under the container admin options. Click the blue + button in...
Read more >
Granting And Modifying Co-Admin Permissions - Box Support
To grant a user co-admin permissions: · Log in to your account and navigate to the Admin Console. · In the lefthand navigation,...
Read more >
Access control with IAM | Container Registry documentation
Verify that you have permissions to manage users. You must have permissions in one of the following roles: Project IAM Admin (roles/resourcemanager.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found