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

[wip] add ssh support #327

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from
Draft

[wip] add ssh support #327

wants to merge 21 commits into from

Conversation

vitaliy-guliy
Copy link
Contributor

@vitaliy-guliy vitaliy-guliy commented Feb 8, 2024

What does this PR do?

It is a current state of the process of adding the Open SSH and the alternative dropbear to the developer container.

Open SSH

The configuration for Open SSH is copied to /opt/ssh/ directory to not being overwritten while workspace startup.
There is /opt/ssh/sshd_config config file and a set of generated ssh keys.

To start the service run /sshd.start script. It will regenerate /home/user/ssh/host_ed25519_key key and will start the service with writing all the output to /tmp/sshd.log.

Open another browser tab an try to connect to the server with /sshd.connect.

At the moment, there is an error appear while authenticate the user

PAM: do_pam_account pam_acct_mgmt = 9 (Authentication service cannot retrieve authentication info)

And the full trace is on the screeenshot

Screenshot from 2024-02-12 22-32-48

All the attempts to configure PAM in /etc/pam.d appeared to be overwritten by kubernetes when workspace is started.

Dropbear

To run the dropbear I created /projects/dropbear directory, generated two edcsa and rsa keys and launched service with

dropbear -FEwgsjk -r /projects/dropbear/dropbear_rsa_host_key -r /projects/dropbear/dropbear_ecdsa_host_key -P /projects/dropbear/dropbear.pid -p 2022

After that it become possible to use the same /sshd.connect script to connect to the service.
Or just use the command ssh -l user -p 2022 -i /home/user/ssh/host_ed25519_key 127.0.0.1.

Like with Open SSH, the login was failed

The output from the service

[14116] Feb 12 22:30:25 Not backgrounding
[14194] Feb 12 22:30:31 Child connection from 127.0.0.1:34192
[14194] Feb 12 22:30:31 Login attempt with wrong user user from 127.0.0.1:34192
[14194] Feb 12 22:30:31 Exit before auth (user 'user', 0 fails): Exited normally

and from the client

$ ssh -i /home/user/.ssh/ssh_host_rsa_key2 -p 2022 127.0.0.1
[email protected]: Permission denied (publickey).

What issues does this PR fix?

eclipse-che/che#22756

How to test this PR?

Click to create a workspace
Contribute

Signed-off-by: vitaliy-guliy <[email protected]>
Copy link

github-actions bot commented Feb 8, 2024

Click here to review and test in web IDE: Contribute

Signed-off-by: vitaliy-guliy <[email protected]>
Copy link

github-actions bot commented Feb 8, 2024

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-327-dev-amd64

1 similar comment
Copy link

github-actions bot commented Feb 8, 2024

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-327-dev-amd64

Copy link

github-actions bot commented Feb 9, 2024

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-327-dev-amd64

Signed-off-by: vitaliy-guliy <[email protected]>
Copy link

github-actions bot commented Feb 9, 2024

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-327-dev-amd64

Copy link

github-actions bot commented Feb 9, 2024

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-327-dev-amd64

Signed-off-by: vitaliy-guliy <[email protected]>
Copy link

github-actions bot commented Feb 9, 2024

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-327-dev-amd64

Copy link

github-actions bot commented Feb 9, 2024

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-327-dev-amd64

Signed-off-by: vitaliy-guliy <[email protected]>
Copy link

github-actions bot commented Feb 9, 2024

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-327-dev-amd64

Copy link

github-actions bot commented Feb 9, 2024

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-327-dev-amd64

Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-327-dev-amd64

1 similar comment
Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-327-dev-amd64

Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-327-dev-amd64

Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-327-dev-amd64

Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-327-dev-amd64

Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-327-dev-amd64

Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-327-dev-amd64

Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-327-dev-amd64

Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-327-dev-amd64

Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-327-dev-amd64

Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-327-dev-amd64

Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-327-dev-amd64

@vitaliy-guliy vitaliy-guliy changed the title add ssh support [wip] add ssh support May 9, 2024
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

Successfully merging this pull request may close these issues.

1 participant