You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-14Lines changed: 16 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
#####Linux-Active-Directory-join-script By Pierre Gode 2017-2024
1
+
# Linux-Active-Directory-join-script By Pierre Gode 2017-2025
2
2
3
3
[](https://github.com/PierreGode/Linux-Active-Directory-join-script/stargazers)[](https://github.com/PierreGode/Linux-Active-Directory-join-script/commits/main)[](https://shields.io/)
4
4
@@ -64,21 +64,22 @@ Usage:
64
64
[-l (script output to log file)]
65
65
[-s (Discover domain)]
66
66
67
-
68
-
67
+
69
68
Usage of the script:
70
69
71
70
sudo sh ADconnection.sh or sudo ./ADconnection.sh
72
71
for ./ADconnection.sh do a
73
72
74
73
sudo chmod +x ADconnection.sh
75
-
first.
76
74
77
-
Complete steps
78
75
79
-
1. remember to set a hostname on the client or server, the AD will set computer object itself named after the hostname of the machine = "linuxcomputer" as example
76
+
# Complete steps
80
77
81
-
2. At this point you have 2 options. you already have a Group i AD example:"ADMINS" here you have your users with sudo rights. then you need to edit /etc/sudoers.d/sudoers
78
+
#### 1. Config
79
+
remember to set a hostname on the client or server, the AD will set computer object itself named after the hostname of the machine = "linuxcomputer" as example
80
+
81
+
#### 2. Permissions
82
+
At this point you have 2 options. you already have a Group i AD example:"ADMINS" here you have your users with sudo rights. then you need to edit /etc/sudoers.d/sudoers
82
83
and add %ADMINS ALL(ALL:ALL) ALL if you want to give this group sudo rights.
83
84
In this script there is a magic word added for groups in AD and it is sudoers, it always adds sudoers after hostname, like linuxcomputersudoers
84
85
administrator will always be added to sudoers as a failsafe for sysadmins.
@@ -87,11 +88,12 @@ and also /etc/ssh/login.allow if you have selected this option for security.
87
88
88
89
Or if you want to manage sudo users by a new group then create a group name LINUXCOMPUTERsudoers and LINUXCOMPUTER as hostname, they are not related, but Computer object in AD will be created and named after hostname and naming the ADgroup simmilar makes search easier in the future, therefore the script by defaut will add "LINUXCOMPUTERsudoers" as default in sudoers.d/sudoers, in this step you don't need to edit files, the script will allow you to choose if you want users to be sudoers or not and if yes the script will autogenerate "LINUXCOMPUTERsudoers" in sudoers
89
90
.
90
-
3. set hostname on you computer to "linuxcomputer" (hostname and hosts files) and reboot
91
+
#### 3. Hostname
92
+
set hostname on you computer to "linuxcomputer" (hostname and hosts files) and reboot
91
93
( in/etc/hosts it should look like 127.0.1.1 LINUXCOMPUTER01 LINUXCOMPUTER01.domain.com also in resolv.conf you should have search domain.com)
92
94
93
-
4. git clone this script and run
94
-
95
+
#### 4. git clone
96
+
git clone this script and run
95
97
Execute the script with sudo sh ADconnection.sh, It will detect if it is a client or a server, it will also detect if client is running ubuntu 14,16,17, 18, 19,20, mate,Debian ,Cent OS,Rasbian ,Fedora, Linux Mint or Kali
96
98
the script will find your domain name if existing, and your networkconfig is correct.. if not a promt will let you type the domain name. "domain.com"
97
99
If there are issues finding the domain please dubblecheck your dns configuration on the domain controller.
@@ -107,12 +109,12 @@ If you current local user is not in the SSH-ALLOW file it will be BANNED from th
107
109
Updated. :Added the ability to choose if you want to dissable SSH-allow,
108
110
note: if ssh is disabled users in other groups will be able to ssh to the client, but will not have sudo rights if they are not members in the group LINUXCOMPUTERsudoers
109
111
110
-
Updated. :
112
+
### Updated. :
111
113
also the ability to choose if clients should have sudo rights or not.
112
114
if you seclect no on this option there is no need for an AD group "LINUXCOMPUTERsudoers" in active directory, all domain users
113
115
will have nonsudo access. "notice this option can NOT be combined with the option YES on ssh-allow"
114
116
115
-
Updates:
117
+
### Updates:
116
118
added join to ubuntu clients with debug mode.
117
119
debugmode will open 2 terminals and will post information while you run the script.
118
120
(does not work over SSH)
@@ -130,13 +132,13 @@ to test access and permissions of a user execute in terminal from administrator
130
132
For best security. I restricted ssh to only domainadmins and local administrator, also clients will be allowed to login from assigned group ( "LINUXCOMPUTERsudoers" ) (with option YES on SSH-allow) (with option YES on sudo rights )
131
133
132
134
133
-
How do i update my password?
135
+
### How do i update my password?
134
136
( changed password but Linux is still on old password )
135
137
This should read new info from AD when you are on "AD" network
136
138
First time you login your "user" caches on the computer ( means that you can login beeing disconected to "office network"
137
139
If you are having problems with the computer not fetching the new password. On office network.. open a terminal and execute sudo service sssd restart, this will reload information, logout and login with the new password.
138
140
139
-
##I have issues!
141
+
### I have issues!
140
142
141
143
1. After reboot I cant login at all. (local or AD)
142
144
"This is problably caused by failed SSH-allow configuration, make sure to have correct users in the configuration or disable SSH-allow when running the script"
0 commit comments