![]() ![]() it would be the user that's running cf ssh).So I've got a laptop running Pop! OS (20.04 LTS), I've just installed openssh-server via sudo apt-get install openssh-server and I'm attempting to SSH into it from my Windows 10 desktop PC but I get the following error: PS C:\Users\enricojr\.ssh> ssh -vvv 192.168.254.203 It just needs to be a valid token for the user that should perform the SSH action (i.e. You could get a valid bearer token in a number of ways, including making direct API calls or using the cf-java-client. This example uses curl to send the request and cf oauth-token to get a valid Oauth2 bearer token for the logged in user. The username will be the format cf:application-guid/app-instance-number, which is easy, but the password needs to be generated with cf ssh-code, or the comparable call to the UAA API.Įx: curl -vv -H 'Accept: application/json' -H "Authorization: $(cf oauth-token)" "" $ sftp -P 2222 cf:$(cf app app-name said, you should be able to do something similar with any standard SSH Java library.Īs mentioned above, the trick is in getting credentials. Here's an example of using a standard SSH/SCP/SFTP client, note that will be your SSH domain, which you can see from cf curl /v2/info: $ ssh -p 2222 cf:$(cf app app-name scp -P 2222 -oUser=cf:$(cf app app-name -guid)/0 my-local-file.json :my-remote-file.json It's standard SSH, but with short-lived credentials so the trick will be generating credentials that you can use from your app. If you're trying to write Java code that would do the same thing as the cf ssh command, that should be possible. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |