Des*_*ume 5 security ssh remote-access osx-mountain-lion macos
出于某种原因,我无法以 root 身份登录我的 Mountain Lion 10.8.2。
我已经/private/etc/sshd_config通过删除评论来编辑文件
PermitRootLogin yes
Run Code Online (Sandbox Code Playgroud)
并重新启动 Mac。当我尝试通过 ssh 进入我的 Mac 时,它仍然显示“拒绝访问”。
我还尝试转到“系统偏好设置”>“共享”>“远程登录”并为“允许访问”选项选择“所有用户”,但我仍然收到“拒绝访问”。远程登录已开启。
我使用的密码是一个有效的 sudoing 密码,与用于编辑/private/etc/sshd_config文件的密码相同。
我试图连接到我的 Mac 的程序是 WinSCP,它基本上是一个文件管理器,所以我不能用它做任何 sudoing,因此真的需要成为 root 才能完全控制我的 Mac 的文件.
迁移到一个答案:
每个苹果:
By default, the root user is not enabled [in Mountain Lion].
Run Code Online (Sandbox Code Playgroud)
这意味着,除非您已启用该帐户并设置了密码 - 您甚至可能没有root启用该用户。根据上面的链接:
Enable the root user
1. Choose Apple menu > System Preferences, and then click Users & Groups.
2. Click the lock icon to unlock it, and then type an administrator name and password.
3. In the Network Account Server section, click Join or Edit.
4. Click Open Directory Utility.
5. Click the lock icon to unlock it, and then enter your administrator name and password.
6. Choose Edit > Enable Root User, and then enter a root user password in the Password and Verify fields.
Be sure to specify a secure password.
Run Code Online (Sandbox Code Playgroud)
然后您可以通过 SSH 和 WinSCP 测试它是否有效。
更短的 Unix 方式
打开终端并运行
sudo passwd
Run Code Online (Sandbox Code Playgroud)
如果需要,输入您的 sudoing 密码,然后在询问时提供 root 帐户的密码。
并且不要忘记将“管理员”添加到允许远程登录的用户列表中。
| 归档时间: |
|
| 查看次数: |
24373 次 |
| 最近记录: |