我正在尝试在嵌入式设备(Synology DS212+ NAS)上运行的 ARM Linux 上安装 bash 作为默认 shell。但确实有些不对劲,我无法弄清楚它是什么。
症状:
1)root有/bin/bash作为默认shell,可以通过SSH正常登录:
$ grep root /etc/passwd
root:x:0:0:root:/root:/bin/bash
$ ssh root@NAS
root@NAS's password:
Last login: Sun Dec 16 14:06:56 2012 from desktop
#
Run Code Online (Sandbox Code Playgroud)
2) joeuser 将 /bin/bash 作为默认 shell,并在尝试通过 SSH 登录时收到“权限被拒绝”:
$ grep joeuser /etc/passwd
joeuser:x:1029:100:Joe User:/home/joeuser:/bin/bash
$ ssh joeuser@localhost
joeuser@NAS's password:
Last login: Sun Dec 16 14:07:22 2012 from desktop
Permission denied, please try again.
Connection to localhost closed.
Run Code Online (Sandbox Code Playgroud)
3) 将 joeuser 的 shell 改回 /bin/sh:
$ grep joeuser /etc/passwd
joeuser:x:1029:100:Joe …
Run Code Online (Sandbox Code Playgroud) 我正在使用 CloudInit 在 AWS 上自动启动我的实例。我遵循了http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/annotate/head%3A/doc/examples/cloud-config.txt上的(稀缺)文档和示例/usr/share/doc/cloud-init
,但是还没想好怎么改默认用户名(ubuntu, id:1000)。
我知道我可以创建一个脚本来手动删除默认的 ubuntu 并添加我的用户,但鉴于 CloudInit 完全存在以自动进行初始设置,这似乎违反直觉。
有任何想法吗?