Skip to content

Commit 329b0cd

Browse files
Notes about LOCAL_USER_ID
1 parent 28a906f commit 329b0cd

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

FAQ.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ for a policy example.
156156
It works as follows: the SageMaker SSH Helper assigns on behalf of the user the tag `SSHOwner`
157157
with the value that equals a local user ID (see [the source code for SSH wrappers](https://github.com/aws-samples/sagemaker-ssh-helper/blob/57b1f6369ce9e523a7951d23753a9f7f5a6a2022/sagemaker_ssh_helper/wrapper.py#L62)).
158158
For integration with SageMaker Studio the user ID is passed in [the notebook](https://github.com/aws-samples/sagemaker-ssh-helper/blob/main/SageMaker_SSH_IDE.ipynb) as the argument to
159-
`sm-ssh-ide init-ssm` command.
159+
`sm-ssh-ide init-ssm` command and configured by the `LOCAL_USER_ID` variable.
160160

161161
When a user attempts to connect to an instance, IAM will authorize the user based
162162
on their ID and the value of the `SSHOwner` tag. The user will be denied to access the instance

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,8 @@ Alternatively, [attach](https://docs.aws.amazon.com/sagemaker/latest/dg/studio-l
727727
Once configured, from the Launcher choose the environment, pick up the lifecycle script and choose
728728
'Open image terminal' (so, you don't even need to create a notebook).
729729

730+
You might want to change the `LOCAL_USER_ID` variable upon the first run, to prevent users from impersonating each other. For more details see the FAQ on [How SageMaker SSH Helper protects users from impersonating each other?](FAQ.md#how-sagemaker-ssh-helper-protects-users-from-impersonating-each-other).
731+
730732
> Note that the `main` branch of this repo can contain changes that are not compatible with the version of `sagemaker-ssh-helper` that you installed from pip. To ensure the stable performance, check the version with `pip freeze | grep sagemaker-ssh-helper` and take the notebook and the lifecycle script from [the corresponding tag](https://github.com/aws-samples/sagemaker-ssh-helper/tags).
731733
732734
2. Configure remote interpreter in PyCharm / VS Code to connect to SageMaker Studio

kernel-lc-config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ JB_LICENSE_SERVER_HOST="jetbrains-license-server.example.com"
1212
# OR keep it as is and populate ~/.vnc/passwd inside SageMaker Studio to override (see https://linux.die.net/man/1/vncpasswd ).
1313
VNC_PASSWORD="123456"
1414

15-
# Replace with a local UserId
15+
# Replace with a local UserId that is returned by `aws sts get-caller-identity` command
1616
# OR keep it as is and put the value into ~/.sm-ssh-owner inside SageMaker Studio to override
1717
LOCAL_USER_ID="AIDACKCEVSQ6C2EXAMPLE:terry@SSO"
1818

0 commit comments

Comments
 (0)