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

Fall back to "/" when home directory doesn't exist for tsh ssh #9413

Merged
merged 10 commits into from
Jan 5, 2022

Conversation

atburke
Copy link
Contributor

@atburke atburke commented Dec 15, 2021

This PR changes tsh ssh's behavior when a user's $HOME points to a non-existent directory. Previously, this caused the command to fail; now, the user's home directory is set to / (this is the same behavior as OpenSSH).

Fixes #2834.

lib/srv/reexec.go Outdated Show resolved Hide resolved
Copy link
Contributor

@russjones russjones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add test coverage?

@zmb3
Copy link
Collaborator

zmb3 commented Dec 21, 2021

Note that assuming os.PathSeparator is a valid directory only works on Linux.

This is probably okay for now, but eventually we'll be running teleport as a Windows service, so could we at least add a // TODO here for Windows support so it's one less random bug to chase down if we want this to work on Windows some day?

@russjones
Copy link
Contributor

@atburke Can you backport this to branch/v7 and branch/v8.

@atburke
Copy link
Contributor Author

atburke commented Jan 4, 2022

@gabrielcorado Can you review this when you have a moment?

Copy link
Contributor

@gabrielcorado gabrielcorado left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for not getting it reviewed sooner.

@atburke atburke enabled auto-merge (squash) January 5, 2022 17:59
@atburke atburke merged commit 94a3099 into master Jan 5, 2022
@atburke atburke deleted the atburke/missing-home-dir branch January 5, 2022 22:09
atburke added a commit that referenced this pull request Jan 5, 2022
This change drops ssh users into the root directory when their home directory doesn't exist. This is the same behavior as OpenSSH.
atburke added a commit that referenced this pull request Jan 5, 2022
This change drops ssh users into the root directory when their home directory doesn't exist. This is the same behavior as OpenSSH.
atburke added a commit that referenced this pull request Jan 7, 2022
…) (#9661)

This change drops ssh users into the root directory when their home directory doesn't exist. This is the same behavior as OpenSSH.
atburke added a commit that referenced this pull request Jan 20, 2022
…) (#9662)

This change drops ssh users into the root directory when their home directory doesn't exist. This is the same behavior as OpenSSH.
@webvictim webvictim mentioned this pull request Mar 4, 2022
@2022liuws
Copy link

2022liuws commented Apr 26, 2022

without home directory will be

disconnected
Failed to launch: fork/exec /proc/1544650/fd/8: permission denied.
Process exited with status 255

how to resolve it

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.

Users without home directory will not be able to log-in
5 participants