cloudfoundry / docs-dev-guide

Documentation for application developers who want to deploy their applications to Cloud Foundry
Apache License 2.0
39 stars 217 forks source link

Cf ssh without cli is out of date #434

Closed ArthurHlt closed 3 years ago

ArthurHlt commented 3 years ago

Documentation for App SSH Access without cf CLI in https://github.com/cloudfoundry/docs-dev-guide/blob/master/deploy-apps/ssh-apps.html.md.erb is out of date, ssh can't be performed with app guid now but with process GUID.

When user try to use ssh like this it will not work now, we give this command to perform ssh now which can help to update the doc:

ssh -p 2222 cf:$(cf curl /v3/apps/$(cf app <APP> --guid)/processes | jq -r '.resources[] | select(.type=="web") | .guid')/0@ssh.endpoint.com

process is a first from web type by default in the cli.

you may found the code in the cli about how they handle username ssh from process here: https://github.com/cloudfoundry/cli/blob/5ffa262bb2e51ba770d456fd169da89ca0b9801f/actor/v7action/ssh.go#L107

cf-gitbot commented 3 years ago

We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.

The labels on this github issue will be updated when the story is started.

animatedmax commented 3 years ago

Hi @ArthurHlt We just tested the steps in https://docs.cloudfoundry.org/devguide/deploy-apps/ssh-apps.html#other-ssh-access with both cf CLI v6 and cf CLI v7 and were able to ssh into the container hosting our test app with no problem.

Both our command and your command allowed us to ssh into the container hosting the first instance of our test app identically, starting with the same prompt "cf:e3614009-cfb0-42a3-87b4-d2e9ed7bab7d/0@ssh.sc2-04-pcf1-system.oc.vmware.com's password:"

Our command: ssh -p 2222 cf:<APP-GUID>/0@ssh.endpoint.com

Your command: ssh -p 2222 cf:$(cf curl /v3/apps/$(cf app test01 --guid)/processes | jq -r '.resources[] | select(.type=="web") | .guid')/0@ssh.endpoint.com

Screen Shot 2021-09-15 at 4 20 47 PM

What version of the cf CLI are you using?

ArthurHlt commented 3 years ago

Hi @animatedmax , thanks to have tried this. I don't think that giving my cli is relevant here as I'm talking about doing ssh without cli.

this was detected by one of my user on our own cloud foundry platform and he was using cf cli v6 latest version, after make him use the cli v7 it's fixed the issue. It's was strange to me so I've tried without using cli and using the format ssh -p 2222 cf:<APP-GUID>/0@ssh.endpoint.com which didn't worked.

After tried, with the other solution I could ssh into the app. After this events this is not the only user who have reported this. I'm suspecting maybe the use of others processes inside container in addition of web process causing the issue. I will try this to make it clear. But we definitely see an issue on this.

We are currently using API version 3.101.0 and our current version of cf-deployment we are using to deploy our cloud foundry is v16.18.0.

animatedmax commented 3 years ago

Hi @ArthurHlt We're adding your command as a new section named "Access App SSH Using Process GUID": https://docs.cloudfoundry.org/devguide/deploy-apps/ssh-apps.html#process-guid

Thank you for suggesting this improvement to the documentation.