Score:0

AWS Ubuntu using public/private key ssh, trying to start a deamon asks for password

ru flag

I set up a new Ubuntu machine on AWS using public/private key as authentication without a password protecting the key (it was generated by the AWS console). I copied the key to my local machine and I am able to login to the remote machine successfully using ssh.

Problem: I am trying to run docker on the remote machine using

systemctl start docker

and I get asked for a password:

Authentication is required to start 'docker.service'. Authenticating as: Ubuntu (ubuntu)

I did not setup any password, how can I tell the shell to use my key instead?

Nate T avatar
it flag
It is probably the key ring or the login manager. Different passwords. did it come with the container? Regarding the message, I've never ran it inside a docker container. Not sure how it is set up. Id check the info on dockerhub, or wherever you got it.
Score:4
in flag

Generally you need to perform Docker commands with sudo. Try this:

sudo service docker start

If you would like the default user account to perform Docker commands without sudo, then you'll need to add ubuntu to the docker group:

sudo usermod -a -G docker ubuntu

You can then test the permissions with something like:

docker info

If you get a permissions issue, you may need to disconnect from the EC2 instance, then reconnect.

ru flag
Thank you @matigo for a complete answer.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.