Différences entre versions de « BootStrapWindows »

De Cliss XXI
Sauter à la navigation Sauter à la recherche
imported>WikiSysop
imported>WikiSysop
(fix vnc)
Ligne 36 : Ligne 36 :
 
cygrunsrv.exe --start sshd
 
cygrunsrv.exe --start sshd
 
</PRE>
 
</PRE>
 +
|-
 +
|bgcolor="yellow" rowspan="1"|
 +
A preparer sur le poste linux de l'operateur
 +
||
 +
<PRE>
 +
apt-get install tigervnc-common
 +
VNCPASS="vncpass"
 +
PASS=$(echo "$VNCPASS" | vncpasswd -f | hexdump -v -e '/1 "%02x "')
 +
echo 'PASS="'$PASS'"'
 +
</PRE>
 +
 
|-
 
|-
 
|bgcolor="lightgreen" rowspan="1"|
 
|bgcolor="lightgreen" rowspan="1"|
Ligne 42 : Ligne 53 :
 
* un role ansible permettant de pousser les clef ssh publique peut etre joué a ce moment.
 
* un role ansible permettant de pousser les clef ssh publique peut etre joué a ce moment.
 
<PRE>
 
<PRE>
VNCPASS="vncpass"
+
PASS="hex-pass" # le pass calcule sur la machine de l'operateur
 
choco install -y tightvnc
 
choco install -y tightvnc
 
regtool  set '\HKLM\software\tightvnc\server\accepthttpconnections' 0
 
regtool  set '\HKLM\software\tightvnc\server\accepthttpconnections' 0
 
regtool  set '\HKLM\software\tightvnc\server\UseVncAuthentication' 1
 
regtool  set '\HKLM\software\tightvnc\server\UseVncAuthentication' 1
PASS=$(echo "$VNCPASS" | vncpasswd -f | hexdump -v -e '/1 "%02x "')
 
 
regtool --binary set '\HKLM\software\tightvnc\server\password' $PASS
 
regtool --binary set '\HKLM\software\tightvnc\server\password' $PASS
 
net stop tvnserver
 
net stop tvnserver

Version du 28 septembre 2018 à 11:57

Accès physique à la machine (écran clavier) + powershell admin

  • Ajouter la machine a l'inventaire (recuperer les adresses MAC, attribuer un nom et une IP)
  • Nommer la machine
  • Créer l'utilisateur "root" si besoin
$PASS = 'rootpass'
net user root '$PASS' /add
net localgroup Administrateurs root /add

Sur une installation anglaise, c'est "Administrators"

  • (Se connecter avec ce nouveau compte (windows initialise des trucs a ce moment là qui simplifie le login ssh sur ce compte par la suite))
  • regler les éventuels pb d'antivirus/firewall (certain en s'installant ou se désinstallant modifie le firewall de windows (en pratique laisser l'antivirus fournis avec l'OS et dégager les autres)
  • Installer chocolatey (cf https://chocolatey.org/install) cygwin, cyg-get, openssh, ouvrir le firewall et lancer un shell cygwin:
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install -y cygwin cyg-get
cyg-get.bat openssh
netsh advfirewall firewall add rule name="ssh" dir=in action=allow protocol=TCP localport=22
netsh advfirewall firewall add rule name="ICMP ping" protocol=icmpv4:8,any dir=in action=allow
C:\tools\cygwin\bin\mintty.exe -

Accès physique à la machine, shell cygwin admin

configurer ssh:

PASS = 'rootpass'
ssh-host-config --yes --name 'sshd' --port 22 --pwd "$PASS"
cygrunsrv.exe --start sshd

A preparer sur le poste linux de l'operateur

apt-get install tigervnc-common
VNCPASS="vncpass"
PASS=$(echo "$VNCPASS" | vncpasswd -f | hexdump -v -e '/1 "%02x "')
echo 'PASS="'$PASS'"'

Accès via ssh

  • un role ansible permettant de pousser les clef ssh publique peut etre joué a ce moment.
PASS="hex-pass" # le pass calcule sur la machine de l'operateur
choco install -y tightvnc
regtool  set '\HKLM\software\tightvnc\server\accepthttpconnections' 0
regtool  set '\HKLM\software\tightvnc\server\UseVncAuthentication' 1
regtool --binary set '\HKLM\software\tightvnc\server\password' $PASS
net stop tvnserver
net start tvnserver
  • note the gui controler quit but tightvncserver is running
choco -y libreoffice thunderbird firefox vlc