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

When enabling ssh, a restart is required. The enable-ssh command should give a hint #1282

Closed
jsievers opened this issue Dec 6, 2017 · 6 comments
Labels
closed due to inactivity closed due to inactivity - reopen if this is still an issue

Comments

@jsievers
Copy link

jsievers commented Dec 6, 2017

Command

cf enable-ssh myapp

What occurred

$ cf enable-ssh myapp
Enabling ssh support for 'myapp'...

OK
$ cf ssh 'myapp'
FAILED
Error opening SSH connection: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain

What you expected to occur

$ cf enable-ssh myapp
Enabling ssh support for 'myapp'...

OK
TIP: Use 'cf restart myapp' to ensure your changes take effect

CLI Version

cf version 6.32.0+0191c33d9.2017-09-26

CC API Endpoint Version

api version: 2.98.0

@cf-gitbot
Copy link
Collaborator

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/153444698

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

stephanme added a commit to stephanme/docs-dev-guide that referenced this issue Dec 7, 2017
If an app is created without ssh access enabled, you need to restart it after enabling ssh before you can actually ssh into it. Otherwise the ssh route doesn't exist and the ssh deamon is not started in the container.

This happens e.g. on landscapes where the ssh access is disabled by default for all apps ([default_app_ssh_access](http://bosh.io/jobs/cloud_controller_ng?source=github.com/cloudfoundry/cf-release&version=281#p=cc.default_app_ssh_access): false).

Related PR for cf cli: cloudfoundry/cli#1282
@dkoper
Copy link

dkoper commented Dec 12, 2017

Thanks for the report!
We'll look at adding a tip for enable-ssh to restart the app to ensure the change takes affect, and also for disable-ssh to restart the app to ensure currently open SSH sessions are terminated.

@giner
Copy link

giner commented Jan 3, 2018

It works for me without restart but it requires some time to wait (10-30 seconds).

@giner
Copy link

giner commented Jan 3, 2018

At the same time I noticed that containers are restarted automatically after enabling or disabling ssh.

$ cf-instances.sh myapp
Application: myapp (292692d6-9156-4e4b-8bc2-3a1327702cb1)
Index  State    Uptime  IP             Port   CPU  Mem   Mem_Quota  Disk  Disk_Quota
0      RUNNING  991s    100.73.61.131  61152  0%   4.7M  64M        7.3M  1024M

$ cf disable-ssh myapp
Disabling ssh support for 'myapp'...
OK

$ cf-instances.sh myapp
Application: myapp (292692d6-9156-4e4b-8bc2-3a1327702cb1)
Index  State    Uptime  IP             Port   CPU   Mem   Mem_Quota  Disk  Disk_Quota
0      RUNNING  0s      100.73.61.131  61164  0.1%  3.4M  64M        7.3M  1024M

@XenoPhex
Copy link
Contributor

XenoPhex commented May 2, 2018

@jsievers thanks for creating this issue. This issue's been documented and we are closing this due to inactivity. The v3 version of this command will work without a restart, so when we release support for v3 commands, this issue (if you are using the latest version of the CF API) should be resolved. Let us know if you have any feedback/comments by either reopening this issue or creating a new one.

@XenoPhex XenoPhex closed this as completed May 2, 2018
@XenoPhex XenoPhex added closed due to inactivity closed due to inactivity - reopen if this is still an issue and removed enhancement labels May 2, 2018
@stefan0001
Copy link

Hi sorry to reopen this topic after such a long time.
Was this issue really fixed in v3?
Tried it with cf version 7.2.0+be4a5ce2b.2020-12-10 and still need to restart the app.

@XenoPhex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed due to inactivity closed due to inactivity - reopen if this is still an issue
Projects
None yet
Development

No branches or pull requests

6 participants