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.

#126 Le 20/11/2022, à 21:28

polinux

Re : Connexion distante d'un PC sur mon serveur [RESOLU]

retour sur le client

facon3@facon3-Inspiron-15-3511:~$ ls /etc/openvpn/client
ca.crt  client1.conf  client1.crt  client1.key  ta.key
facon3@facon3-Inspiron-15-3511:~$ 

Hors ligne

#127 Le 20/11/2022, à 21:30

NicoApi73

Re : Connexion distante d'un PC sur mon serveur [RESOLU]

Que donne :

grep -C1 'cert c' /etc/openvpn/client1.conf

Hors ligne

#128 Le 20/11/2022, à 21:33

polinux

Re : Connexion distante d'un PC sur mon serveur [RESOLU]

facon3@facon3-Inspiron-15-3511:~$ grep -C1 'cert c' /etc/openvpn/client1.conf
grep: /etc/openvpn/client1.conf: Aucun fichier ou dossier de ce type
facon3@facon3-Inspiron-15-3511:~$ 

Hors ligne

#129 Le 20/11/2022, à 21:34

NicoApi73

Re : Connexion distante d'un PC sur mon serveur [RESOLU]

J'ai fait une faute de frappe, j'ai oublié un répertoire :

grep -C1 'cert c' /etc/openvpn/client/client1.conf

Hors ligne

#130 Le 20/11/2022, à 21:36

polinux

Re : Connexion distante d'un PC sur mon serveur [RESOLU]

et voila le retour

facon3@facon3-Inspiron-15-3511:~$ grep -C1 'cert c' /etc/openvpn/client/client1.conf
ca ca.crt
cert client1.crt
key client1.key
facon3@facon3-Inspiron-15-3511:~$ 

Hors ligne

#131 Le 20/11/2022, à 21:45

NicoApi73

Re : Connexion distante d'un PC sur mon serveur [RESOLU]

Pour l'instant, je ne vois pas.

Fais les commandes suivantes :

sudo systemctl start openvpn-client@client1.service
sudo cat /var/log/syslog | tail -50

Hors ligne

#132 Le 20/11/2022, à 21:48

polinux

Re : Connexion distante d'un PC sur mon serveur [RESOLU]

facon3@facon3-Inspiron-15-3511:~$ sudo systemctl start openvpn-client@client1.service
[sudo] Mot de passe de facon3 : 
Job for openvpn-client@client1.service failed because the control process exited with error code.
See "systemctl status openvpn-client@client1.service" and "journalctl -xeu openvpn-client@client1.service" for details.
facon3@facon3-Inspiron-15-3511:~$ sudo cat /var/log/syslog | tail -50
Nov 20 20:38:57 facon3-Inspiron-15-3511 systemd-udevd[6673]: sda1: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/sda1' failed with exit code 1.
Nov 20 20:38:57 facon3-Inspiron-15-3511 udisksd[633]: Mounted /dev/sda1 at /media/facon3/server on behalf of uid 1000
Nov 20 20:38:57 facon3-Inspiron-15-3511 kernel: [35527.980326] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: errors=remount-ro. Quota mode: none.
Nov 20 20:38:57 facon3-Inspiron-15-3511 dbus-daemon[1493]: [session uid=1000 pid=1493] Activating service name='org.gnome.Shell.HotplugSniffer' requested by ':1.38' (uid=1000 pid=1708 comm="/usr/bin/gnome-shell " label="unconfined")
Nov 20 20:38:57 facon3-Inspiron-15-3511 dbus-daemon[1493]: [session uid=1000 pid=1493] Successfully activated service 'org.gnome.Shell.HotplugSniffer'
Nov 20 20:39:01 facon3-Inspiron-15-3511 CRON[6722]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Nov 20 20:39:02 facon3-Inspiron-15-3511 systemd[1]: Starting Clean php session files...
Nov 20 20:39:02 facon3-Inspiron-15-3511 systemd[1]: phpsessionclean.service: Deactivated successfully.
Nov 20 20:39:02 facon3-Inspiron-15-3511 systemd[1]: Finished Clean php session files.
Nov 20 20:39:20 facon3-Inspiron-15-3511 dbus-daemon[1493]: [session uid=1000 pid=1493] Activating service name='org.gnome.Nautilus' requested by ':1.38' (uid=1000 pid=1708 comm="/usr/bin/gnome-shell " label="unconfined")
Nov 20 20:39:20 facon3-Inspiron-15-3511 dbus-daemon[1493]: [session uid=1000 pid=1493] Successfully activated service 'org.gnome.Nautilus'
Nov 20 20:39:21 facon3-Inspiron-15-3511 dbus-daemon[559]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.149' (uid=1000 pid=6771 comm="/usr/bin/nautilus --gapplication-service " label="unconfined")
Nov 20 20:39:21 facon3-Inspiron-15-3511 systemd[1]: Starting Hostname Service...
Nov 20 20:39:21 facon3-Inspiron-15-3511 nautilus[6771]: Called "net usershare info" but it failed: L’exécution du processus fils « net » a échoué (No such file or directory)
Nov 20 20:39:21 facon3-Inspiron-15-3511 dbus-daemon[559]: [system] Successfully activated service 'org.freedesktop.hostname1'
Nov 20 20:39:21 facon3-Inspiron-15-3511 systemd[1]: Started Hostname Service.
Nov 20 20:39:47 facon3-Inspiron-15-3511 systemd[1480]: Started Application launched by gnome-shell.
Nov 20 20:39:47 facon3-Inspiron-15-3511 dbus-daemon[1493]: [session uid=1000 pid=1493] Activating via systemd: service name='org.gnome.Terminal' unit='gnome-terminal-server.service' requested by ':1.180' (uid=1000 pid=6795 comm="/usr/bin/gnome-terminal.real " label="unconfined")
Nov 20 20:39:47 facon3-Inspiron-15-3511 systemd[1480]: Starting GNOME Terminal Server...
Nov 20 20:39:47 facon3-Inspiron-15-3511 dbus-daemon[1493]: [session uid=1000 pid=1493] Successfully activated service 'org.gnome.Terminal'
Nov 20 20:39:47 facon3-Inspiron-15-3511 systemd[1480]: Started GNOME Terminal Server.
Nov 20 20:39:47 facon3-Inspiron-15-3511 systemd[1480]: Started VTE child process 6818 launched by gnome-terminal-server process 6800.
Nov 20 20:39:51 facon3-Inspiron-15-3511 systemd[1]: systemd-hostnamed.service: Deactivated successfully.
Nov 20 21:09:01 facon3-Inspiron-15-3511 CRON[6947]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Nov 20 21:09:23 facon3-Inspiron-15-3511 systemd[1]: Starting Clean php session files...
Nov 20 21:09:23 facon3-Inspiron-15-3511 systemd[1]: phpsessionclean.service: Deactivated successfully.
Nov 20 21:09:23 facon3-Inspiron-15-3511 systemd[1]: Finished Clean php session files.
Nov 20 21:11:18 facon3-Inspiron-15-3511 systemd[1]: Created slice Slice /system/openvpn-client.
Nov 20 21:11:18 facon3-Inspiron-15-3511 systemd[1]: Starting OpenVPN tunnel for client1...
Nov 20 21:11:18 facon3-Inspiron-15-3511 openvpn[6999]: Cannot pre-load keyfile (ta)
Nov 20 21:11:18 facon3-Inspiron-15-3511 openvpn[6999]: Exiting due to fatal error
Nov 20 21:11:18 facon3-Inspiron-15-3511 systemd[1]: openvpn-client@client1.service: Main process exited, code=exited, status=1/FAILURE
Nov 20 21:11:18 facon3-Inspiron-15-3511 systemd[1]: openvpn-client@client1.service: Failed with result 'exit-code'.
Nov 20 21:11:18 facon3-Inspiron-15-3511 systemd[1]: Failed to start OpenVPN tunnel for client1.
Nov 20 21:17:01 facon3-Inspiron-15-3511 CRON[7022]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Nov 20 21:30:01 facon3-Inspiron-15-3511 CRON[7078]: (root) CMD ([ -x /etc/init.d/anacron ] && if [ ! -d /run/systemd/system ]; then /usr/sbin/invoke-rc.d anacron start >/dev/null; fi)
Nov 20 21:34:23 facon3-Inspiron-15-3511 systemd[1]: Started Run anacron jobs.
Nov 20 21:34:23 facon3-Inspiron-15-3511 anacron[7099]: Anacron 2.3 started on 2022-11-20
Nov 20 21:34:23 facon3-Inspiron-15-3511 anacron[7099]: Normal exit (0 jobs run)
Nov 20 21:34:23 facon3-Inspiron-15-3511 systemd[1]: anacron.service: Deactivated successfully.
Nov 20 21:39:00 facon3-Inspiron-15-3511 systemd[1]: Starting Clean php session files...
Nov 20 21:39:00 facon3-Inspiron-15-3511 systemd[1]: phpsessionclean.service: Deactivated successfully.
Nov 20 21:39:00 facon3-Inspiron-15-3511 systemd[1]: Finished Clean php session files.
Nov 20 21:39:01 facon3-Inspiron-15-3511 CRON[7167]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Nov 20 21:46:44 facon3-Inspiron-15-3511 systemd[1]: Starting OpenVPN tunnel for client1...
Nov 20 21:46:44 facon3-Inspiron-15-3511 systemd[1]: openvpn-client@client1.service: Main process exited, code=exited, status=1/FAILURE
Nov 20 21:46:44 facon3-Inspiron-15-3511 openvpn[7203]: Cannot pre-load keyfile (ta)
Nov 20 21:46:44 facon3-Inspiron-15-3511 openvpn[7203]: Exiting due to fatal error
Nov 20 21:46:44 facon3-Inspiron-15-3511 systemd[1]: openvpn-client@client1.service: Failed with result 'exit-code'.
Nov 20 21:46:44 facon3-Inspiron-15-3511 systemd[1]: Failed to start OpenVPN tunnel for client1.
facon3@facon3-Inspiron-15-3511:~$ 

Hors ligne

#133 Le 20/11/2022, à 21:51

NicoApi73

Re : Connexion distante d'un PC sur mon serveur [RESOLU]

Que donne :

grep -C1 'ta.key' /etc/openvpn/client/client1.conf

Hors ligne

#134 Le 20/11/2022, à 21:52

polinux

Re : Connexion distante d'un PC sur mon serveur [RESOLU]

grep -C1 'ta.key' /etc/openvpn/client/client1.conf

Hors ligne

#135 Le 20/11/2022, à 21:53

NicoApi73

Re : Connexion distante d'un PC sur mon serveur [RESOLU]

Retour vide?

Hors ligne

#136 Le 20/11/2022, à 21:53

polinux

Re : Connexion distante d'un PC sur mon serveur [RESOLU]

je suis allé trop vite j'ai publié la question pas la réponse

facon3@facon3-Inspiron-15-3511:~$ grep -C1 'ta.key' /etc/openvpn/client/client1.conf
# then every client must also have the key.
;tls-auth ta.key 1
tls-crypt ta key

facon3@facon3-Inspiron-15-3511:~$ 

Hors ligne

#137 Le 20/11/2022, à 21:55

NicoApi73

Re : Connexion distante d'un PC sur mon serveur [RESOLU]

ok, l'erreur est ici .Ouvre le fichier de conf, tu n'as pas mis de . entre ta et key :

tls-crypt ta.key

EDIT : je me permets de dire "tu n'as pas mis", j'ai vérifié, le . était bien au #53 big_smile

Dernière modification par NicoApi73 (Le 20/11/2022, à 21:58)

Hors ligne

#138 Le 20/11/2022, à 21:59

polinux

Re : Connexion distante d'un PC sur mon serveur [RESOLU]

voici le retour avec la modif

facon3@facon3-Inspiron-15-3511:~$ grep -C1 'ta.key' /etc/openvpn/client/client1.conf
# then every client must also have the key.
;tls-auth ta.key 1
tls-crypt ta.key

facon3@facon3-Inspiron-15-3511:~$ 

Hors ligne

#139 Le 20/11/2022, à 22:01

NicoApi73

Re : Connexion distante d'un PC sur mon serveur [RESOLU]

Tu peux recommencer :

sudo systemctl start openvpn-client@client1.service
sudo systemctl status openvpn-client@client1.service

Puis, s'il n'y a pas d'erreur, sur ton serveur, donne :

sudo cat /var/log/openvpn/openvpn.log

Dernière modification par NicoApi73 (Le 20/11/2022, à 22:14)

Hors ligne

#140 Le 20/11/2022, à 22:04

polinux

Re : Connexion distante d'un PC sur mon serveur [RESOLU]

facon3@facon3-Inspiron-15-3511:~$ sudo systemctl start openvpn-client@client1.service
facon3@facon3-Inspiron-15-3511:~$
facon3@facon3-Inspiron-15-3511:~$ sudo systemctl status openvpn-client@client1.service
× openvpn-client@client1.service - OpenVPN tunnel for client1
     Loaded: loaded (/lib/systemd/system/openvpn-client@.service; disabled; ven>
     Active: failed (Result: exit-code) since Sun 2022-11-20 22:02:00 CET; 1min>
       Docs: man:openvpn(8)
             https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage
             https://community.openvpn.net/openvpn/wiki/HOWTO
    Process: 7277 ExecStart=/usr/sbin/openvpn --suppress-timestamps --nobind -->
   Main PID: 7277 (code=exited, status=1/FAILURE)
     Status: "Pre-connection initialization successful"
        CPU: 17ms

nov. 20 22:02:00 facon3-Inspiron-15-3511 systemd[1]: Started OpenVPN tunnel for>
nov. 20 22:02:00 facon3-Inspiron-15-3511 openvpn[7277]: Outgoing Control Channe>
nov. 20 22:02:00 facon3-Inspiron-15-3511 openvpn[7277]: Outgoing Control Channe>
nov. 20 22:02:00 facon3-Inspiron-15-3511 openvpn[7277]: Incoming Control Channe>
nov. 20 22:02:00 facon3-Inspiron-15-3511 openvpn[7277]: Incoming Control Channe>
nov. 20 22:02:00 facon3-Inspiron-15-3511 openvpn[7277]: RESOLVE: Cannot resolve>
nov. 20 22:02:00 facon3-Inspiron-15-3511 openvpn[7277]: failed to find GID for >
nov. 20 22:02:00 facon3-Inspiron-15-3511 openvpn[7277]: Exiting due to fatal er>
nov. 20 22:02:00 facon3-Inspiron-15-3511 systemd[1]: openvpn-client@client1.ser>
nov. 20 22:02:00 facon3-Inspiron-15-3511 systemd[1]: openvpn-client@client1.ser>
lines 1-21/21 (END)

retour du client

Hors ligne

#141 Le 20/11/2022, à 22:06

polinux

Re : Connexion distante d'un PC sur mon serveur [RESOLU]

coté serveur mad

facon-piscine@facon-piscine:~$ cat /var/log/openvpn/openvpn.log
cat: /var/log/openvpn/openvpn.log: Permission non accordée
facon-piscine@facon-piscine:~$ 

Hors ligne

#142 Le 20/11/2022, à 22:10

NicoApi73

Re : Connexion distante d'un PC sur mon serveur [RESOLU]

Pour le serveur, il faut maintenant sudo devant (j'avais oublié), comme il y a une autre erreur sur le client, pour l'instant il faut corriger cette autre erreur...

Sur le client :

sudo cat /var/log/syslog | tail -50

Et donne moi tout le fichier de conf STP (La seule info perso qu'il pourrait y avoir, c'est l'adresse IP publique, qui normalement n'est pas présente pour l'instant) :

cat /etc/openvpn/client/client1.conf

Hors ligne

#143 Le 20/11/2022, à 22:11

polinux

Re : Connexion distante d'un PC sur mon serveur [RESOLU]

facon3@facon3-Inspiron-15-3511:~$ sudo cat /var/log/syslog | tail -50
Nov 20 20:39:47 facon3-Inspiron-15-3511 dbus-daemon[1493]: [session uid=1000 pid=1493] Activating via systemd: service name='org.gnome.Terminal' unit='gnome-terminal-server.service' requested by ':1.180' (uid=1000 pid=6795 comm="/usr/bin/gnome-terminal.real " label="unconfined")
Nov 20 20:39:47 facon3-Inspiron-15-3511 systemd[1480]: Starting GNOME Terminal Server...
Nov 20 20:39:47 facon3-Inspiron-15-3511 dbus-daemon[1493]: [session uid=1000 pid=1493] Successfully activated service 'org.gnome.Terminal'
Nov 20 20:39:47 facon3-Inspiron-15-3511 systemd[1480]: Started GNOME Terminal Server.
Nov 20 20:39:47 facon3-Inspiron-15-3511 systemd[1480]: Started VTE child process 6818 launched by gnome-terminal-server process 6800.
Nov 20 20:39:51 facon3-Inspiron-15-3511 systemd[1]: systemd-hostnamed.service: Deactivated successfully.
Nov 20 21:09:01 facon3-Inspiron-15-3511 CRON[6947]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Nov 20 21:09:23 facon3-Inspiron-15-3511 systemd[1]: Starting Clean php session files...
Nov 20 21:09:23 facon3-Inspiron-15-3511 systemd[1]: phpsessionclean.service: Deactivated successfully.
Nov 20 21:09:23 facon3-Inspiron-15-3511 systemd[1]: Finished Clean php session files.
Nov 20 21:11:18 facon3-Inspiron-15-3511 systemd[1]: Created slice Slice /system/openvpn-client.
Nov 20 21:11:18 facon3-Inspiron-15-3511 systemd[1]: Starting OpenVPN tunnel for client1...
Nov 20 21:11:18 facon3-Inspiron-15-3511 openvpn[6999]: Cannot pre-load keyfile (ta)
Nov 20 21:11:18 facon3-Inspiron-15-3511 openvpn[6999]: Exiting due to fatal error
Nov 20 21:11:18 facon3-Inspiron-15-3511 systemd[1]: openvpn-client@client1.service: Main process exited, code=exited, status=1/FAILURE
Nov 20 21:11:18 facon3-Inspiron-15-3511 systemd[1]: openvpn-client@client1.service: Failed with result 'exit-code'.
Nov 20 21:11:18 facon3-Inspiron-15-3511 systemd[1]: Failed to start OpenVPN tunnel for client1.
Nov 20 21:17:01 facon3-Inspiron-15-3511 CRON[7022]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Nov 20 21:30:01 facon3-Inspiron-15-3511 CRON[7078]: (root) CMD ([ -x /etc/init.d/anacron ] && if [ ! -d /run/systemd/system ]; then /usr/sbin/invoke-rc.d anacron start >/dev/null; fi)
Nov 20 21:34:23 facon3-Inspiron-15-3511 systemd[1]: Started Run anacron jobs.
Nov 20 21:34:23 facon3-Inspiron-15-3511 anacron[7099]: Anacron 2.3 started on 2022-11-20
Nov 20 21:34:23 facon3-Inspiron-15-3511 anacron[7099]: Normal exit (0 jobs run)
Nov 20 21:34:23 facon3-Inspiron-15-3511 systemd[1]: anacron.service: Deactivated successfully.
Nov 20 21:39:00 facon3-Inspiron-15-3511 systemd[1]: Starting Clean php session files...
Nov 20 21:39:00 facon3-Inspiron-15-3511 systemd[1]: phpsessionclean.service: Deactivated successfully.
Nov 20 21:39:00 facon3-Inspiron-15-3511 systemd[1]: Finished Clean php session files.
Nov 20 21:39:01 facon3-Inspiron-15-3511 CRON[7167]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Nov 20 21:46:44 facon3-Inspiron-15-3511 systemd[1]: Starting OpenVPN tunnel for client1...
Nov 20 21:46:44 facon3-Inspiron-15-3511 systemd[1]: openvpn-client@client1.service: Main process exited, code=exited, status=1/FAILURE
Nov 20 21:46:44 facon3-Inspiron-15-3511 openvpn[7203]: Cannot pre-load keyfile (ta)
Nov 20 21:46:44 facon3-Inspiron-15-3511 openvpn[7203]: Exiting due to fatal error
Nov 20 21:46:44 facon3-Inspiron-15-3511 systemd[1]: openvpn-client@client1.service: Failed with result 'exit-code'.
Nov 20 21:46:44 facon3-Inspiron-15-3511 systemd[1]: Failed to start OpenVPN tunnel for client1.
Nov 20 22:02:00 facon3-Inspiron-15-3511 systemd[1]: Starting OpenVPN tunnel for client1...
Nov 20 22:02:00 facon3-Inspiron-15-3511 openvpn[7277]: OpenVPN 2.5.5 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Jul 14 2022
Nov 20 22:02:00 facon3-Inspiron-15-3511 openvpn[7277]: library versions: OpenSSL 3.0.2 15 Mar 2022, LZO 2.10
Nov 20 22:02:00 facon3-Inspiron-15-3511 systemd[1]: Started OpenVPN tunnel for client1.
Nov 20 22:02:00 facon3-Inspiron-15-3511 openvpn[7277]: Outgoing Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key
Nov 20 22:02:00 facon3-Inspiron-15-3511 openvpn[7277]: Outgoing Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication
Nov 20 22:02:00 facon3-Inspiron-15-3511 openvpn[7277]: Incoming Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key
Nov 20 22:02:00 facon3-Inspiron-15-3511 openvpn[7277]: Incoming Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication
Nov 20 22:02:00 facon3-Inspiron-15-3511 openvpn[7277]: RESOLVE: Cannot resolve host address: my-server-1:192.168.0.30 (Servname not supported for ai_socktype)
Nov 20 22:02:00 facon3-Inspiron-15-3511 openvpn[7277]: failed to find GID for group nobody: No such file or directory (errno=2)
Nov 20 22:02:00 facon3-Inspiron-15-3511 openvpn[7277]: Exiting due to fatal error
Nov 20 22:02:00 facon3-Inspiron-15-3511 systemd[1]: openvpn-client@client1.service: Main process exited, code=exited, status=1/FAILURE
Nov 20 22:02:00 facon3-Inspiron-15-3511 systemd[1]: openvpn-client@client1.service: Failed with result 'exit-code'.
Nov 20 22:09:01 facon3-Inspiron-15-3511 CRON[7313]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Nov 20 22:09:05 facon3-Inspiron-15-3511 systemd[1]: Starting Clean php session files...
Nov 20 22:09:05 facon3-Inspiron-15-3511 systemd[1]: phpsessionclean.service: Deactivated successfully.
Nov 20 22:09:05 facon3-Inspiron-15-3511 systemd[1]: Finished Clean php session files.
facon3@facon3-Inspiron-15-3511:~$ 

Hors ligne

#144 Le 20/11/2022, à 22:13

polinux

Re : Connexion distante d'un PC sur mon serveur [RESOLU]

facon3@facon3-Inspiron-15-3511:~$ cat /etc/openvpn/client/client1.conf
##############################################
# Sample client-side OpenVPN 2.0 config file #
# for connecting to multi-client server.     #
#                                            #
# This configuration can be used by multiple #
# clients, however each client should have   #
# its own cert and key files.                #
#                                            #
# On Windows, you might want to rename this  #
# file so it has a .ovpn extension           #
##############################################

# Specify that we are a client and that we
# will be pulling certain config file directives
# from the server.
client

# Use the same setting as you are using on
# the server.
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
;dev tap
dev tun

# Windows needs the TAP-Win32 adapter name
# from the Network Connections panel
# if you have more than one.  On XP SP2,
# you may need to disable the firewall
# for the TAP adapter.
;dev-node MyTap

# Are we connecting to a TCP or
# UDP server?  Use the same setting as
# on the server.
proto tcp
;proto udp

# The hostname/IP and port of the server.
# You can have multiple remote entries
# to load balance between the servers.
remote my-server-1 192.168.0.30
;remote my-server-2 192.168.0.30

# Choose a random host from the remote
# list for load-balancing.  Otherwise
# try hosts in the order specified.
;remote-random

# Keep trying indefinitely to resolve the
# host name of the OpenVPN server.  Very useful
# on machines which are not permanently connected
# to the internet such as laptops.
resolv-retry infinite

# Most clients don't need to bind to
# a specific local port number.
nobind

# Downgrade privileges after initialization (non-Windows only)
user nobody
group nobody

# Try to preserve some state across restarts.
persist-key
persist-tun

# If you are connecting through an
# HTTP proxy to reach the actual OpenVPN
# server, put the proxy server/IP and
# port number here.  See the man page
# if your proxy server requires
# authentication.
;http-proxy-retry # retry on connection failures
;http-proxy [proxy server] [proxy port #]

# Wireless networks often produce a lot
# of duplicate packets.  Set this flag
# to silence duplicate packet warnings.
;mute-replay-warnings

# SSL/TLS parms.
# See the server config file for more
# description.  It's best to use
# a separate .crt/.key file pair
# for each client.  A single ca
# file can be used for all clients.
ca ca.crt
cert client1.crt
key client1.key

# Verify server certificate by checking that the
# certificate has the correct key usage set.
# This is an important precaution to protect against
# a potential attack discussed here:
#  http://openvpn.net/howto.html#mitm
#
# To use this feature, you will need to generate
# your server certificates with the keyUsage set to
#   digitalSignature, keyEncipherment
# and the extendedKeyUsage to
#   serverAuth
# EasyRSA can do this for you.
remote-cert-tls server

# If a tls-auth key is used on the server
# then every client must also have the key.
;tls-auth ta.key 1
tls-crypt ta.key

# Select a cryptographic cipher.
# If the cipher option is used on the server
# then you must also specify it here.
# Note that v2.4 client/server will automatically
# negotiate AES-256-GCM in TLS mode.
# See also the data-ciphers option in the manpage
;cipher AES-256-CBC
cipher AES-256-GCM
auth SHA256
# Enable compression on the VPN link.
# Don't enable this unless it is also
# enabled in the server config file.
#comp-lzo

# Set log file verbosity.
verb 3

# Silence repeating messages
;mute 20
key-direction 1
facon3@facon3-Inspiron-15-3511:~$ 

Hors ligne

#145 Le 20/11/2022, à 22:14

NicoApi73

Re : Connexion distante d'un PC sur mon serveur [RESOLU]

Ouvre ton fichier de conf :
Trouve les lignes :

user nobody
group nogroup

Après group, c'est nogroup et pas nobody big_smile

Hors ligne

#146 Le 20/11/2022, à 22:15

NicoApi73

Re : Connexion distante d'un PC sur mon serveur [RESOLU]

Tu pourras ensuite recommencer le #139 (j'ai rajouté le sudo)

Hors ligne

#147 Le 20/11/2022, à 22:21

polinux

Re : Connexion distante d'un PC sur mon serveur [RESOLU]

facon3@facon3-Inspiron-15-3511:~$ sudo systemctl start openvpn-client@client1.service
facon3@facon3-Inspiron-15-3511:~$ sudo systemctl status openvpn-client@client1.service
● openvpn-client@client1.service - OpenVPN tunnel for client1
     Loaded: loaded (/lib/systemd/system/openvpn-client@.service; disabled; ven>
     Active: active (running) since Sun 2022-11-20 22:20:05 CET; 22s ago
       Docs: man:openvpn(8)
             https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage
             https://community.openvpn.net/openvpn/wiki/HOWTO
   Main PID: 7405 (openvpn)
     Status: "Pre-connection initialization successful"
      Tasks: 1 (limit: 9150)
     Memory: 1.8M
        CPU: 16ms
     CGroup: /system.slice/system-openvpn\x2dclient.slice/openvpn-client@client>
             └─7405 /usr/sbin/openvpn --suppress-timestamps --nobind --config c>

nov. 20 22:20:20 facon3-Inspiron-15-3511 openvpn[7405]: Restart pause, 5 second>
nov. 20 22:20:25 facon3-Inspiron-15-3511 openvpn[7405]: Outgoing Control Channe>
nov. 20 22:20:25 facon3-Inspiron-15-3511 openvpn[7405]: Outgoing Control Channe>
nov. 20 22:20:25 facon3-Inspiron-15-3511 openvpn[7405]: Incoming Control Channe>
nov. 20 22:20:25 facon3-Inspiron-15-3511 openvpn[7405]: Incoming Control Channe>
nov. 20 22:20:25 facon3-Inspiron-15-3511 openvpn[7405]: RESOLVE: Cannot resolve>
nov. 20 22:20:25 facon3-Inspiron-15-3511 openvpn[7405]: RESOLVE: Cannot resolve>
nov. 20 22:20:25 facon3-Inspiron-15-3511 openvpn[7405]: Could not determine IPv>
nov. 20 22:20:25 facon3-Inspiron-15-3511 openvpn[7405]: SIGUSR1[soft,init_insta>
lines 1-23

Hors ligne

#148 Le 20/11/2022, à 22:24

polinux

Re : Connexion distante d'un PC sur mon serveur [RESOLU]

J'ai fais encore une erreur

facon3@facon3-Inspiron-15-3511:~$ sudo cat /var/log/openvpn/openvpn.log
cat: /var/log/openvpn/openvpn.log: Aucun fichier ou dossier de ce type
facon3@facon3-Inspiron-15-3511:~$ 

Hors ligne

#149 Le 20/11/2022, à 22:25

NicoApi73

Re : Connexion distante d'un PC sur mon serveur [RESOLU]

Tu es bon pour retourner dans ton fichier de conf (client):

La ligne

remote my-server-1 192.168.0.30

En fait ii faut que ce soit :

remote 192.168.0.30 1194

Dernière modification par NicoApi73 (Le 20/11/2022, à 22:26)

Hors ligne

#150 Le 20/11/2022, à 22:30

polinux

Re : Connexion distante d'un PC sur mon serveur [RESOLU]

facon3@facon3-Inspiron-15-3511:~$ sudo systemctl start openvpn-client@client1.service
facon3@facon3-Inspiron-15-3511:~$ sudo systemctl status openvpn-client@client1.service
● openvpn-client@client1.service - OpenVPN tunnel for client1
     Loaded: loaded (/lib/systemd/system/openvpn-client@.service; disabled; ven>
     Active: active (running) since Sun 2022-11-20 22:20:05 CET; 7min ago
       Docs: man:openvpn(8)
             https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage
             https://community.openvpn.net/openvpn/wiki/HOWTO
   Main PID: 7405 (openvpn)
     Status: "Pre-connection initialization successful"
      Tasks: 1 (limit: 9150)
     Memory: 1.8M
        CPU: 21ms
     CGroup: /system.slice/system-openvpn\x2dclient.slice/openvpn-client@client>
             └─7405 /usr/sbin/openvpn --suppress-timestamps --nobind --config c>

nov. 20 22:22:55 facon3-Inspiron-15-3511 openvpn[7405]: Restart pause, 160 seco>
nov. 20 22:25:35 facon3-Inspiron-15-3511 openvpn[7405]: Outgoing Control Channe>
nov. 20 22:25:35 facon3-Inspiron-15-3511 openvpn[7405]: Outgoing Control Channe>
nov. 20 22:25:35 facon3-Inspiron-15-3511 openvpn[7405]: Incoming Control Channe>
nov. 20 22:25:35 facon3-Inspiron-15-3511 openvpn[7405]: Incoming Control Channe>
nov. 20 22:25:35 facon3-Inspiron-15-3511 openvpn[7405]: RESOLVE: Cannot resolve>
nov. 20 22:25:35 facon3-Inspiron-15-3511 openvpn[7405]: RESOLVE: Cannot resolve>
nov. 20 22:25:35 facon3-Inspiron-15-3511 openvpn[7405]: Could not determine IPv>
nov. 20 22:25:35 facon3-Inspiron-15-3511 openvpn[7405]: SIGUSR1[soft,init_insta>
lines 1-23

Je vais me faire harra qui rit

facon3@facon3-Inspiron-15-3511:~$ sudo cat /var/log/openvpn/openvpn.log
cat: /var/log/openvpn/openvpn.log: Aucun fichier ou dossier de ce type
facon3@facon3-Inspiron-15-3511:~$ 

Hors ligne