Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 09/02/2021, à 10:11

jerome-mairie

integration ubuntu 20.04 dans un AD sous Win 2019

Bonjour à tous, j'espère poster dans la bonne catégorie.

Je voulais essayer d'intégrer un poste en ubuntu 20.04 à mon Ad sous Windows 2019, j'ai donc scrupuleusement suivi ce tuto.

Tout c'est super bien passé, jusqu'au moment de la connexion au compte AD avec la commande "su -".

Là, la connexion ne passe pas et la commande renvoi soit une erreur d'authentification, soit une erreur système.

En regardant mon terminal lors de l'exécution de la commande "id", avec divers utilisateurs AD, j'ai toujours dans ma liste des groupes un code avec inscrit "groupe de réplication de mot de passe RODC refusé@mondomaine".

Je pense qu'il me manque un paquet mais lequel ?

Merci pour vos futures réponses.

Hors ligne

#2 Le 09/02/2021, à 12:22

geole

Re : integration ubuntu 20.04 dans un AD sous Win 2019

jerome-mairie a écrit :

Tout c'est super bien passé, jusqu'au moment de la connexion au compte AD avec la commande "su -".

Là, la connexion ne passe pas et la commande renvoi soit une erreur d'authentification, soit une erreur système.

Merci pour vos futures réponses.

Bonjour
Je pense que tu devrais dire clairement l'erreur rencontrée    (copier/coller) en précisant exactement  à quel endroit endroit du tuto cela se trouve


Les grilles de l'installateur https://doc.ubuntu-fr.org/tutoriel/inst … _subiquity
"gedit admin:///etc/fstab" est proscrit,  utilisez "pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY xdg-open /etc/fstab" Voir  https://doc.ubuntu-fr.org/gedit
Les partitions EXT4 des disques externes => https://forum.ubuntu-fr.org/viewtopic.p … #p22697248

En ligne

#3 Le 09/02/2021, à 15:58

jerome-mairie

Re : integration ubuntu 20.04 dans un AD sous Win 2019

Quand je lance la commande su - "utilisateur"@"mondomaine", la commande me demande mon mot de passe, je le tape et quand je valide aulieu de me creer mon répertoire de travail dans /home et de me connecter à mon compte utilisateur, ça marque "su: Erreur système".


Edit : Pour plus d'info, voila le une partie du contenu de mon fichier /var/log/auth.log

Feb  9 16:23:40 jerome-OptiPlex-790 su: pam_unix(su-l:auth): Couldn't open /etc/securetty: Aucun fichier ou dossier de ce type
Feb  9 16:23:46 jerome-OptiPlex-790 su: pam_unix(su-l:auth): Couldn't open /etc/securetty: Aucun fichier ou dossier de ce type
Feb  9 16:23:46 jerome-OptiPlex-790 su: pam_unix(su-l:auth): authentication failure; logname= uid=1000 euid=0 tty=pts/3 ruser=jerome rhost=  user=administrateur@mondomaine
Feb  9 16:23:46 jerome-OptiPlex-790 su: pam_sss(su-l:auth): authentication success; logname= uid=1000 euid=0 tty=pts/3 ruser=jerome rhost= user=administrateur@mondomaine
Feb  9 16:23:46 jerome-OptiPlex-790 su: pam_sss(su-l:account): Access denied for user administrateur@mondomaine: 4 (Erreur système)
Feb  9 16:23:46 jerome-OptiPlex-790 su: FAILED SU (to administrateur@mondomaine) jerome on pts/3
Feb  9 16:24:01 jerome-OptiPlex-790 sudo: pam_unix(sudo:auth): Couldn't open /etc/securetty: Aucun fichier ou dossier de ce type
Feb  9 16:24:05 jerome-OptiPlex-790 sudo: pam_unix(sudo:auth): Couldn't open /etc/securetty: Aucun fichier ou dossier de ce type
Feb  9 16:24:05 jerome-OptiPlex-790 sudo:   jerome : TTY=pts/3 ; PWD=/home/jerome ; USER=root ; COMMAND=/usr/bin/vim /var/log/auth.log
Feb  9 16:24:05 jerome-OptiPlex-790 sudo: pam_unix(sudo:session): session opened for user root by (uid=0)
~

Dernière modification par jerome-mairie (Le 09/02/2021, à 16:32)

Hors ligne

#4 Le 13/08/2021, à 17:17

gg25

Re : integration ubuntu 20.04 dans un AD sous Win 2019

Bonjour,

Voilà ce qui fonctionne chez nous
Essaie avec ce script en PowerShell a lancer depuis ton PC déjà inscrit sur ton AD : (je te conseille de metre les 2 fichiers a la racine de ton C)

Change ce qui est inscrit en : Nom de Domaine et adresse du serveur


if ( $env:userdomain -match "Nom de Domaine" ) 
{
  $BASE="DC=Nom de Domaine,DC=group"
  $ADDC1="Adresse serveur.group"
  $groupPath="OU=Security_Groups,OU=FRANCE,$BASE"
  $WorkstationPath="OU=Linux,OU=Workstations,OU=FRANCE,$BASE";
  $ServerPath="OU=Servers,OU=FRANCE,$BASE";
}

if ( $env:userdomain -match "Nom de Domaine" ) 
{
  $BASE="DC=Nom de Domaine,DC=com"
  $ADDC1="Adresse du serveur"
  $groupPath="OU=Groups,OU=*******,OU=France,$BASE"
  $WorkstationPath="OU=Computers,OU=*******,OU=FRANCE,$BASE";
  $ServerPath="OU=Servers,$BASE";
}


$ErrorActionPreference = "Stop"
$GSHEET_MAC2NAME="1c6hVHHasRdSbrAglwsI8Oj9D1f0RHLzt1acTTsW8jE4"


function GraphicInputComputer
{
  Add-Type -AssemblyName System.Windows.Forms
  Add-Type -AssemblyName System.Drawing

  $form = New-Object System.Windows.Forms.Form
  $form.Text = "Create $env:userdomain computer"
  $form.Size = New-Object System.Drawing.Size(440,140)
  $form.StartPosition = 'CenterScreen'

  $OKButton = New-Object System.Windows.Forms.Button
  $OKButton.Location = New-Object System.Drawing.Point(340,60)
  $OKButton.Size = New-Object System.Drawing.Size(75,23)
  $OKButton.Text = 'CREATE'
  $OKButton.DialogResult = [System.Windows.Forms.DialogResult]::OK
  $form.AcceptButton = $OKButton
  $form.Controls.Add($OKButton)

  $CancelButton = New-Object System.Windows.Forms.Button
  $CancelButton.Location = New-Object System.Drawing.Point(260,60)
  $CancelButton.Size = New-Object System.Drawing.Size(75,23)
  $CancelButton.Text = 'Cancel'
  $CancelButton.DialogResult = [System.Windows.Forms.DialogResult]::Cancel
  $form.CancelButton = $CancelButton
  $form.Controls.Add($CancelButton)

  $label = New-Object System.Windows.Forms.Label
  $label.Location = New-Object System.Drawing.Point(10,20)
  $label.Size = New-Object System.Drawing.Size(120,20)
  $label.Text = 'Computer name :'
  $form.Controls.Add($label)

  $textBox = New-Object System.Windows.Forms.TextBox
  $textBox.Location = New-Object System.Drawing.Point(130,20)
  $textBox.Size = New-Object System.Drawing.Size(260,20)
  $form.Controls.Add($textBox)

  $Font = New-Object System.Drawing.Font("Times NewRoman",6,[System.Drawing.FontStyle]::Italic)
  $help = New-Object System.Windows.Forms.Label
  $help.Font = $Font
  $help.Location = New-Object System.Drawing.Point(10,50)
  $help.Size = New-Object System.Drawing.Size(160,50)
  $help.Text = 'Desktop : Nom du PC  Portable: Nom du PC Server: Non du serveur'
  $form.Controls.Add($help)

  
  $form.Topmost = $true
  $result = $form.ShowDialog()
  $computer = $textBox.Text

  return ($computer.ToUpper())
/*
  if ( ($result -eq [System.Windows.Forms.DialogResult]::OK) -And ($computer) )
  {
    return ($computer.ToUpper())
  }
  */
}


#************************************************************************************************
function set-Group-GID
{
 param([string]$name)

    $group=Get-ADGroup -Identity "${name}"
    $a = $group.SID.Value.Split("-")
    if( $a[7] -eq $null) { $gid = $a[4] } else { $gid = $a[7] }
    if( $group.gidNumber -eq $null )
    {
	  Write-Host $group.SamAccountName
	  Set-ADGroup -Identity $Group.SID -Add @{gidNumber=$gid}
    }
}


#************************************************************************************************
function Create-Linux-Groups 
{
 param([string]$name, [string]$groupPath)


  foreach ( $key in @("access", "admin") ) 
  {
   Try 
    {
       Get-ADGroup -Identity "${name}-${key}"
       Write-Warning "Group ${name}-${key} already exist !"
    }
    Catch
    {
      $Group = New-ADGroup "${name}-${key}" -Path "$groupPath" -GroupCategory Security -GroupScope Global -PassThru –Verbose
      set-Group-GID("$Group")
    }
  }
}


# *************************************************************************************************
function createComputerAccount 
{
  param([string]$computer)

  $computer = $computer.ToUpper();
  if ( $computer -match '[A-Z]{2}\-[A-Z]{3}\-SRV[A-Z]{2,4}\d{1,5}' )
   { 
     $Path="$ServerPath";
     Write-Output "OK : SERVER --> $Path"
     Create-Linux-Groups -name $computer -groupPath "$groupPath";
   } 
   elseif ( $computer -match '[A-Z]{2}\-[A-Z]{3}\-LP[T:L]{1}\d{5}' ) 
   { 
     $Path="$WorkstationPath";
     Write-Output "OK : Laptop --> $Path"
   } 
   elseif ( $computer -match '[A-Z]{2}\-[A-Z]{3}\-DK[T:L]{1}\d{5}' ) 
   { 
     $Path="$WorkstationPath";
     Write-Output "OK : Desktop --> $Path"
   } 
   else 
   { 
     [System.Windows.MessageBox]::Show("Invalid name : [$computer]");
     return("");
   } 

   
  do 
  { 
    Get-ADComputer -Server $ADDC1 -Filter { Name -eq $computer } | Remove-ADObject -Recursive
    Start-Sleep -s 1
    $c = Get-ADComputer  -Server $ADDC1 -Filter { Name -eq $computer } 
    Write-Output "Waiting for AD account to be removed ..."
  } while (-not([String]::IsNullOrWhiteSpace($c)))


  Write-Host "Creating Computer $computer account in $Path, on $ADDC1,  please wait ..."
  New-ADComputer -Name "$computer" -Server $ADDC1 -SamAccountName "$computer" -Path "$Path" -Enabled $True -AccountPassword (ConvertTo-SecureString -AsPlainText "$computer#${GSHEET_MAC2NAME}%" -Force) 
  
  do 
  { 
    Start-Sleep -s 1
    $c = Get-ADComputer  -Server $ADDC1  -Filter { Name -eq $computer } 
    Write-Output "Waiting for AD account to be created ..."
  } while ([String]::IsNullOrWhiteSpace($c))

  Write-Output "SUCCESS : machine account $computer created:!"
  return($computer)
}


##########################################################################################################################
##########################################################################################################################
##########################################################################################################################

do 
{ 
  $computer = GraphicInputComputer;
  $r = createComputerAccount($computer);
} while ([String]::IsNullOrWhiteSpace($r))

puis tu le lances en administrateur avec ce point bat

:debut
powershell -file .\linuxPC.ps1
pause
goto debut

Dernière modification par Ayral (Le 13/08/2021, à 21:58)

Hors ligne

#5 Le 13/08/2021, à 18:04

cqfd93

Re : integration ubuntu 20.04 dans un AD sous Win 2019

Modération

Bonjour,

Pour ajouter toi-même les balises code à ton message #4 :

  • Cliquer sur le lien « Modifier » en bas à droite du message

  • Sélectionner le texte

  • Cliquer sur le <> de l'éditeur de message
    1471986854.png


cqfd93

Hors ligne