AWS SageMaker环境下文件所有者异常及SSH权限报错求助
AWS SageMaker环境下文件所有者异常及SSH权限报错求助
各位好,我遇到了一个棘手的SageMaker权限问题,想请教大家怎么解决:
今天我在AWS SageMaker Studio里提交文件到远程仓库时,突然遇到了SSH权限报错,具体信息如下:
Bad owner or permissions on /home/sagemaker-user/.ssh/config fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
我做了一些排查,发现问题根源可能和用户目录的所有者异常有关:
- 查看
/home目录的权限信息时,发现我的主目录/home/sagemaker-user/的所有者居然是sagemaker-studio和一个未知的UID(65534),而不是预期的sagemaker-user:
sagemaker-user@studio$ ls -la /home total 4 drwxr-xr-x 1 root root 30 Feb 27 14:18 . drwxr-xr-x 1 root root 73 Feb 27 14:18 .. drwx------ 2 sagemaker-studio sagemaker-studio 62 Feb 27 14:18 sagemaker-studio drwx------ 22 sagemaker-studio 65534 6144 Feb 27 14:47 sagemaker-user
- 尝试用
chown命令递归修改目录所有者,但哪怕切换到root用户执行,也提示操作不被允许:
sagemaker-user@studio$ sudo su root root@studio$ sudo chown -R sagemaker-user /home/sagemaker-user/ ... chown: changing ownership of XXXX Operation not permitted
- 我也试过尝试切换到
sagemaker-studio用户来修改,但sudo切换时需要输入密码,而我根本不知道这个用户的密码。 - 更奇怪的是,当我以默认的
sagemaker-user身份新建文件时,文件的所有者居然是sagemaker-studio:
sagemaker-user@studio$ whoami sagemaker-user sagemaker-user@studio$ touch test sagemaker-user@studio$ ls -la test -rw-r--r-- 1 sagemaker-studio users 0 Feb 27 15:05 test
这个问题是突然出现的,我账号下其他的SageMaker域都正常,所有文件的所有者都是sagemaker-user。当前这个异常的SageMaker环境是基于CentOS系统的,有没有朋友遇到过类似问题,或者知道怎么修复这个权限异常呢?
备注:内容来源于stack exchange,提问作者Gonzalo Hernandez
相关产品推荐
相关产品推荐

