|
| 1 | +--- |
| 2 | +title: Manage SSH access for domain accounts in Azure HDInsight |
| 3 | +description: Steps to manage SSH access for Azure AD accounts in HDInsight. |
| 4 | +author: hrasheed-msft |
| 5 | +ms.author: hrasheed |
| 6 | +ms.reviewer: jasonh |
| 7 | +ms.service: hdinsight |
| 8 | +ms.topic: conceptual |
| 9 | +ms.date: 02/14/2020 |
| 10 | +--- |
| 11 | + |
| 12 | +# Manage SSH access for domain accounts in Azure HDInsight |
| 13 | + |
| 14 | +On secure clusters, by default, all domain users in [Azure AD DS](../../active-directory-domain-services/overview.md) are allowed to [SSH](../hdinsight-hadoop-linux-use-ssh-unix.md) into the head and edge nodes. These users are not part of the sudoers group and do not get root access. The SSH user created during cluster creation will have root access. |
| 15 | + |
| 16 | +## Manage access |
| 17 | + |
| 18 | +To modify SSH access to specific users or groups, update `/etc/ssh/sshd_config` on each of the nodes. |
| 19 | + |
| 20 | +1. Use [ssh command](../hdinsight-hadoop-linux-use-ssh-unix.md) to connect to your cluster. Edit the command below by replacing CLUSTERNAME with the name of your cluster, and then enter the command: |
| 21 | + |
| 22 | + ```cmd |
| 23 | + |
| 24 | + ``` |
| 25 | +
|
| 26 | +1. Open the `ssh_confi`g file. |
| 27 | +
|
| 28 | + ```bash |
| 29 | + sudo nano /etc/ssh/sshd_config |
| 30 | + ``` |
| 31 | +
|
| 32 | +1. Modify the `sshd_config` file as desired. If you restrict users to certain groups, then the local accounts cannot SSH into that node. The following is only an example of syntax: |
| 33 | +
|
| 34 | + ```bash |
| 35 | + AllowUsers useralias1 useralias2 |
| 36 | +
|
| 37 | + AllowGroups groupname1 groupname2 |
| 38 | + ``` |
| 39 | +
|
| 40 | + Then save changes: **Ctrl + X**, **Y**, **Enter**. |
| 41 | +
|
| 42 | +1. Restart sshd. |
| 43 | +
|
| 44 | + ```bash |
| 45 | + sudo systemctl restart sshd |
| 46 | + ``` |
| 47 | +
|
| 48 | +1. Repeat above steps for each node. |
| 49 | +
|
| 50 | +## SSH authentication log |
| 51 | +
|
| 52 | +SSH authentication log is written into `/var/log/auth.log`. If you see any login failures through SSH for local or domain accounts, you will need to go through the log to debug the errors. Often the issue might be related to specific user accounts and it's usually a good practice to try other user accounts or SSH using the default SSH user (local account) and then attempt a kinit. |
| 53 | +
|
| 54 | +## SSH debug log |
| 55 | +
|
| 56 | +To enable verbose logging, you will need to restart `sshd` with the `-d` option. Like `/usr/sbin/sshd -d` You can also run `sshd` at a custom port (like 2222) so that you don't have to stop the main SSH daemon. You can also use `-v` option with the SSH client to get more logs (client side view of the failures). |
| 57 | +
|
| 58 | +## Next steps |
| 59 | +
|
| 60 | +* [Manage HDInsight clusters with Enterprise Security Package](./apache-domain-joined-manage.md) |
| 61 | +* [Connect to HDInsight (Apache Hadoop) using SSH](../hdinsight-hadoop-linux-use-ssh-unix.md). |
0 commit comments