Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dcos service log requires ssh credentials #146

Closed
r0c opened this issue Jul 8, 2016 · 13 comments
Closed

dcos service log requires ssh credentials #146

r0c opened this issue Jul 8, 2016 · 13 comments

Comments

@r0c
Copy link

r0c commented Jul 8, 2016

Please answer the following questions before submitting your issue. Thanks!

What version of DC/OS + DC/OS CLI are you using (dcos --version)?

If DC/OS CLI version < 0.4.5, DC/OS version can be found at `http://dcos_url/dcos-metada/dcos-version.json

root@swarm-master02:/# dcos --version
dcoscli.version=0.4.8
dcos.version=1.7-open
dcos.commit=14509fe1e7899f439527fb39867194c7a425c771
dcos.bootstrap-id=3a2b7e03c45cd615da8dfb1b103943894652cd71

What operating system and version are you using?

root@swarm-master02:/# cat /etc/debian_version
7.11

root@swarm-master02:/# python -V
Python 3.4.5

root@swarm-master02:/# pip -V
pip 8.1.2 from /usr/local/lib/python3.4/site-packages (python 3.4)

What did you do?

If possible please provide a recipe for reproducing.

  1. installed the dcos cli
  2. ran 'dcos auth login' --- result was correct
  3. ran 'dcos service' --- result was correct
  4. ran 'dcos service log marathon' --- stuck here asking for password

root@swarm-master02:/# dcos service log marathon
Running ssh core@X.X.X.X journalctl -n 10 -u dcos-marathon
Password:

What did you expect to see?

The dcos cli node is in the same network as the dcos cluster, according to the manual, I should see the logs.

What did you see instead?

Asking for ssh password

@tamarrow-zz
Copy link
Contributor

Hi @r0c. What manual are you referring to and where are you running the cli from? Is the master node publicly from where the cli is running from? You probably need to add your aws key to your ssh-agent.

@jsancio
Copy link
Contributor

jsancio commented Jul 27, 2016

@tamarrow and @r0c I think the other possible issue is that core in ssh core@x.x.x.x may not be a valid user. It should be possible to set the right user with the --ssh-config-file flag.

We should add features to DC/OS to make it possible to expose the journald logs without having to ssh. cc. @pyronicide and @malnick

@dispalt
Copy link

dispalt commented Aug 5, 2016

I figure it would be easiest to add a new setting called user to the config file, then anytime you ssh via node ssh or look at marathon logs, it would use that as default.

@grampelberg
Copy link
Contributor

@ddispaltro what do you think about configuring the SSH options instead?

@dispalt
Copy link

dispalt commented Aug 8, 2016

You mean in your ~/.ssh/config, if so I am good with that. The tool doesn't seem to respect it though.

@grampelberg
Copy link
Contributor

I suspect that's because we're using IPs and jumping hosts. We need to make it obvious how to do that config!

@fpapleux
Copy link

fpapleux commented Jan 9, 2017

I think this is related. I am doing dcos node ssh --leader --master-copy and it is asking me for a password. I can't find this password anywhere.

@partounian
Copy link

@fpapleux I am trying to use dcos node ssh to get into Redis as per the tutorial but I'm having the same issue as you. Were you able to find a solution?

@ayen-tibco
Copy link

ayen-tibco commented Jul 27, 2017

@fpapleux by default, dcos ssh utilize default user 'core'. For vagrant local installation of dcos, it's 'vagrant'.

dcos node ssh --master-proxy --user=vagrant --mesos-id=$(dcos task redis --json | jq -r '.[] | .slave_id')

@siavashk
Copy link

Why isn’t this mentioned as part of DCOS 101 tutorial? Or better yet, add vagrant as a user option to the ssh command:

dcos node ssh --master-proxy --mesos-id=$(dcos task redis --json | jq -r '.[] | .slave_id’) --user=vagrant

Knowing the correct combination of username/password for vagrant is not exactly common knowledge.

@sudosaket
Copy link

If you are using Vagrant, the --user=vagrant switch works. Note it still asks for a password, I entered the password as vagrant and I got in.

@RogerWeihrauch
Copy link

Hello @ALL
You are all right on how to change the user when SSHing into one node's name/ip.
But ,what can I do in the following case when there is a pswd for the user core requested:
'dcos service log marathon'?
I did not find any 'workaround' to change the user with, e.g., '--user=vagrant'.
Is there any solution to change the user from 'core' to 'vagrant' when executing above mentioned dcos service log command?
Your response will be highly appreciated.
Regards,
Roger

@cepefernando
Copy link

I fixed this issue by going through https://docs.mesosphere.com/1.7/administration/sshcluster/

  1. chmod 600 .pem (Grant permissions)
  2. cp .pem ~/.ssh/.pem (Copy key to local ssh path)
  3. ssh-add ~/.ssh/.pem
  4. dcos node ssh --master-proxy --mesos-id=

Now it is not asking for a password. Hope this helps.

@armandgrillet armandgrillet transferred this issue from dcos/dcos-cli Jan 15, 2019
@janisz janisz closed this as completed Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests