Peerotechnik

  • 15 déc. 2024
  • Inscrit 2 oct. 2016
  • Patience, je débute avec Debian.

  • Bonjour tout l'monde

    Avec mon client FTP j'arrive à télécharger, depuis mon serveur, sur mon PC les fichiers désirés.
    Par contre, le transfert inverse depuis mon PC pour envoyer un fichier à mon serveur m'est interdit. "Upload erreur: Permission denied"

    J'ai fait la commande
    /etc/init.d/fail2ban stop

    Malgré cela il m'est toujours interdit de faire un upload.
    Mes attributs de dossier sont : drwxr-xr-x

    Je précise encore :
    Que mon port SSH a été modifié et que je ne me connecte pas en root.

    Bonnes et heureuses Fêtes pour tout l'monde

  • Merci Wagner pour ta réponse. Je tiens à préciser que mon serveur est uniquement en Debian 10-64.

  • J'ai encore un petit souci avec mon serveur :

    Je peux récupérer les fichiers du serveur à mon PC, mais il m'est interdit d'envoyer des fichiers à mon serveur (permission denied).
    Même effacer un fichier sur mon serveur m'est interdit via mon client FTP.

    • J'utilise FlashFXP.
    • Mon firewall permet la connexion à mon serveur.
    • Avec ruTorrent je peux effacer tous les fichiers.
    • La permission pour les dossiers = drwxr-xr-x
    • La permission pour les fichiers = rw-r--r-

    PS:
    Lorsque j'ai fait la mise à jour de mon serveur, un message concernant "Grub" est apparu me demandant de choisir la partition pour l'installer. Ne sachant laquelle choisir, je l'ai empêché de s'installer. Je n'avais jamais entendu parlé de Grub

    Merci pour votre aide 😃

  • MattProd
    Merci pour ton intervention et béni soit ton oeil qui repère les erreurs. C'était bien la redondance (3x) de la location /rutorrent.

  • Bonjour tout l'monde

    Je n'arrive plus à redémarrer nginx.

    systemctl restart nginx
    
    Job for nginx.service failed because the control process exited with error code.
    See "systemctl status nginx.service" and "journalctl -xe" for details.
    

    systemctl status nginx
    
    ● nginx.service - nginx - high performance web server
       Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
       Active: **failed** (Result: exit-code) since Sat 2020-08-29 18:52:45 CEST; 16s ago
         Docs: http://nginx.org/en/docs/
      Process: 8290 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=1/FAILURE)
    
    Aug 29 18:52:45 113500HD010180 systemd[1]: Starting nginx - high performance web server...
    Aug 29 18:52:45 113500HD010180 nginx[8290]: nginx: [emerg] duplicate location "/rutorrent" in /etc/nginx/sites-enabled/rutorre
    Aug 29 18:52:45 113500HD010180 systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
    Aug 29 18:52:45 113500HD010180 systemd[1]: **nginx.service: Failed with result** 'exit-code'.
    Aug 29 18:52:45 113500HD010180 systemd[1]: **Failed to start nginx - high performance web server.**
    

    journalctl-xe
    
    -- Subject: Unit failed
    -- Defined-By: systemd
    -- Support: https://www.debian.org/support
    --
    -- The unit nginx.service has entered the 'failed' state with result 'exit-code'.
    Aug 29 18:52:19 113500HD010180 systemd[1]: Failed to start nginx - high performance web server.
    -- Subject: A start job for unit nginx.service has failed
    -- Defined-By: systemd
    -- Support: https://www.debian.org/support
    --
    -- A start job for unit nginx.service has finished with a failure.
    --
    -- The job identifier is 1055 and the job result is failed.
    Aug 29 18:52:45 113500HD010180 systemd[1]: Starting nginx - high performance web server...
    -- Subject: A start job for unit nginx.service has begun execution
    -- Defined-By: systemd
    -- Support: https://www.debian.org/support
    --
    -- A start job for unit nginx.service has begun execution.
    --
    -- The job identifier is 1133.
    Aug 29 18:52:45 113500HD010180 nginx[8290]: nginx: [emerg] duplicate location "/rutorrent" in /etc/nginx/sites-enabled/rutorrent.conf:75
    Aug 29 18:52:45 113500HD010180 systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
    -- Subject: Unit process exited
    -- Defined-By: systemd
    -- Support: https://www.debian.org/support
    --
    -- An ExecStart= process belonging to unit nginx.service has exited.
    --
    -- The process' exit code is 'exited' and its exit status is 1.
    Aug 29 18:52:45 113500HD010180 systemd[1]: nginx.service: Failed with result 'exit-code'.
    -- Subject: Unit failed
    -- Defined-By: systemd
    -- Support: https://www.debian.org/support
    --
    -- The unit nginx.service has entered the 'failed' state with result 'exit-code'.
    Aug 29 18:52:45 113500HD010180 systemd[1]: Failed to start nginx - high performance web server.
    -- Subject: A start job for unit nginx.service has failed
    -- Defined-By: systemd
    -- Support: https://www.debian.org/support
    --
    -- A start job for unit nginx.service has finished with a failure.
    --
    -- The job identifier is 1133 and the job result is failed.
    

    ============================

    Merci pour votre aide 😀

  • qo_op Ben, c'était bien une inversion du service et de la commande. 😅
    Merci pour votre aide à tous les deux.

  • Bonjour et bonne santé à tout l'monde

    J'ai un petit problème avec Filemanager.

    Lors de l'ouverture de ruTorrent avec mon navigateur, le message suivant apparaît:

    • --- FILEMANAGER Echec de la récupération du contenu du dossier :/ ---

    Si je me positionne sur l'onglet de "File Manager" et que je désire naviguer dans les répertoires, le message indiqué sis-dessus apparaît à nouveau.

    Voici mon filemanager/conf.php

    <?php
    
    $fm['tempdir'] = '/tmp';                // path were to store temporary data ; must be writable
    $fm['mkdperm'] = 755;           // default permission to set to new created directories
    
    // set with fullpath to binary or leave empty
    
    if(empty($pathToExternals['rar']))      // May be path already defined?
    {
            $pathToExternals['rar'] = '/usr/bin/rar';
    }
    if(empty($pathToExternals['zip']))      // May be path already defined?
    {
            $pathToExternals['zip'] = '/usr/bin/zip';
    }
    if(empty($pathToExternals['unzip']))    // May be path already defined?
    {
            $pathToExternals['unzip'] = '/usr/bin/unzip';
    }
    if(empty($pathToExternals['tar']))      // May be path already defined?
    {
            $pathToExternals['tar'] = '/usr/bin/tar';
    }
    if(empty($pathToExternals['gzip']))     // May be path already defined?
    {
            $pathToExternals['gzip'] = '/usr/bin/gzip';
    }
    if(empty($pathToExternals['bzip2']))    // May be path already defined?
    {
            $pathToExternals['bzip2'] = '/usr/bin/bzip2';
    }
    
    // archive mangling, see archiver man page before editing
    
    $fm['archive']['types'] = array('rar', 'zip', 'tar', 'gzip', 'bzip2');
    
    $fm['archive']['compress'][0] = range(0, 5);
    $fm['archive']['compress'][1] = array('-0', '-1', '-9');
    $fm['archive']['compress'][2] = $fm['archive']['compress'][3] = $fm['archive']['compress'][4] = array(0);
    
    ?>

    Infos supplémentaires:¨

    • Je ne me connecte plus avec root, mais avec un nouvel utilisateur créé autre que celui de rTorrent.
    • Bonjour
      Lorsque je veux stopper, redémarrer un paquet comme ssh, nginx etc... et que je tape les commandes suivantes:

      113500HD010180 ~ # service nginx stop
      bash: service: command not found
      113500HD010180 ~ # systemctl nginx stop
      Unknown operation nginx.
      113500HD010180 ~ # sudo /etc/init.d/nginx stop
      [ ok ] Stopping nginx (via systemctl): nginx.service.
      113500HD010180 ~ #

      Je n'arrive au résultat voulu qu'avec la commande
      sudo /etc/init.d/ ssh restart

      Y'a-t-il moyen de faire que les commandes service ou systemctl soient possible à nouveau ?

    • Bonjour et Bonne Année 2019 pour tout le monde !!

      Depuis quelques mois et dès une mise à jour de mon serveur, je n'arrive plus à me connecter au serveur avec mon client FTP.

      Le message d'erreur est :

      • L'authentification a échoué [utilisateur inconnu ou mot de passe non valide.]
      • SSH Erreur: Impossible de négocier la méthode d'authentification

      Ce qui est étrange c'est que je suis certain de l'utilisateur et de mon mot de passe. J'ai comme l'impression que c'est plutôt une interdiction à mon client FTP. Comme s'il n'avait pas l'autorisation d'accès (possible ou pas ?).

      Remarques:
      Debian 8
      Fail2Ban Activé ou pas ne change rien.
      Je peux télécharger les torrents avec mon extension de Firefox sur les sites.
      J'ai accès à mon interface rutorrent avec Firefox et peux ici télécharger mes torrents sur local.
      Avec Filezilla ou FlashFXP5, problème identique. (Connexion refusée)

      Merci d'avance.

      -
      SOLUTION TROUVÉE !!

      Il me manquait dans le fichier de configuration SSH mon utilisateur de seedbox, celui de ma connexion y était.
      nano /etc/ssh/sshd_config

      # Choix des utilisateurs autorisés à se connecter,
      # ajouter l'user qu'on a créé plus haut, plus les utilisateurs de ruTorrent pour qu'ils conservent l'accès en SFTP.
      AllowUsers votre_user user_ruTorrent

      Pourtant au bas de la config de SSH il y a:
      Match user user_ruTorrent # etc... note : pas d'espace entre les virgules

      Je pensais que c'était suffisant.

      • Re... 😉

        J'ai un "petit" souci avec ma sécurisation SSH. Je n'arrive ni à changer mon port, ni interdire la connexion "non root", ni à permettre un nouvel utilisateur pour la connexion SSH.

        Pour commencer: si je change seulement le port 22 en port xxxxx, déjà là je ne peux plus me connecter avec la console. Je précise que plusieurs ports ont été testés et que le restart de SSH a été fait.

        /etc/init.d/ssh restart

        Je publie mon fichier de config. de SSH pour voir si une ou plusieurs incorrections y figurent.
        <utilisateur-nouveau> = le nom de utilisateur créer pour la connexion SSH. (décommentée si le besoin est)
        Match user <utilisateur-rutorrent> = utilisateur créé pour le rutorrent

        nano /etc/ssh/sshd_config

        Mon SSH

        # Package generated configuration file
        # See the sshd_config(5) manpage for details
        
        # What ports, IPs and protocols we listen for
        Port 22
        # Use these options to restrict which interfaces/protocols sshd will bind to
        #ListenAddress ::
        #ListenAddress 0.0.0.0
        Protocol 2
        # HostKeys for protocol version 2
        HostKey /etc/ssh/ssh_host_rsa_key
        HostKey /etc/ssh/ssh_host_dsa_key
        HostKey /etc/ssh/ssh_host_ecdsa_key
        HostKey /etc/ssh/ssh_host_ed25519_key
        #Privilege Separation is turned on for security
        UsePrivilegeSeparation yes
        
        # Lifetime and size of ephemeral version 1 server key
        KeyRegenerationInterval 3600
        ServerKeyBits 1024
        
        # Logging
        SyslogFacility AUTH
        LogLevel INFO
        
        # Authentication:
        LoginGraceTime 120
        PermitRootLogin yes
        StrictModes yes
        # Choix des utilisateurs autorisés à se connecter,
        # Ajouter nouvel user qu'on a créé plus haut.
        # AllowUsers <utilisateur-nouveau>
        
        RSAAuthentication yes
        PubkeyAuthentication yes
        #AuthorizedKeysFile     %h/.ssh/authorized_keys
        
        # Don't read the user's ~/.rhosts and ~/.shosts files
        IgnoreRhosts yes
        # For this to work you will also need host keys in /etc/ssh_known_hosts
        RhostsRSAAuthentication no
        # similar for protocol version 2
        HostbasedAuthentication no
        # Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
        #IgnoreUserKnownHosts yes
        
        # To enable empty passwords, change to yes (NOT RECOMMENDED)
        PermitEmptyPasswords no
        
        # Change to yes to enable challenge-response passwords (beware issues with
        # some PAM modules and threads)
        ChallengeResponseAuthentication no
        
        # Change to no to disable tunnelled clear text passwords
        #PasswordAuthentication yes
        
        # Kerberos options
        #KerberosAuthentication no
        #KerberosGetAFSToken no
        #KerberosOrLocalPasswd yes
        #KerberosTicketCleanup yes
        
        # GSSAPI options
        #GSSAPIAuthentication no
        #GSSAPICleanupCredentials yes
        
        X11Forwarding yes
        X11DisplayOffset 10
        PrintMotd no
        PrintLastLog yes
        TCPKeepAlive yes
        #UseLogin no
        
        #MaxStartups 10:30:60
        #Banner /etc/issue.net
        
        # Allow client to pass locale environment variables
        AcceptEnv LANG LC_*
        
        #Subsystem sftp /usr/lib/openssh/sftp-server
        Subsystem sftp internal-sftp
        
        # Set this to 'yes' to enable PAM authentication, account processing,
        # and session processing. If this is enabled, PAM authentication will
        # be allowed through the ChallengeResponseAuthentication and
        # PasswordAuthentication.  Depending on your PAM configuration,
        # PAM authentication via ChallengeResponseAuthentication may bypass
        # the setting of "PermitRootLogin without-password".
        # If you just want the PAM account and session checks to run without
        # PAM authentication, then enable this but set PasswordAuthentication
        # and ChallengeResponseAuthentication to 'no'.
        UsePAM yes
        
        Match user <utilisateur-rutorrent> # etc... note : pas d'espace entre les virgules
        ChrootDirectory %h
        
      • Pour le bannissement en tapant ban + IP à bannir :

        Est-il possible de bannir une plage d'IP de par exemple: 26.16.0.0 à 26.16.256.256 ?
        Si oui comment taper cette plage ?

        ou faut-il directement aller sur iptables ?

        Merci

      • Avec la commande ./certbot-auto renew le renouvellement de mon certificat ne se fait pas, j'ai donc du opter pour une autre approche.

        J'ai pu renouveler mon certificat pour 3 mois en faisant la commande suivante:

        service nginx stop
        ./certbot-auto certonly 

        Au dialogue suivant, j'ai sélectionné #2 (standalone)

        How would you like to authenticate with the ACME CA?
        -----------------
        1: Nginx Web Server plugin - Alpha (nginx)
        2: Spin up a temporary webserver (standalone)
        3: Place files in webroot directory (webroot)

        - Puis indiquer ses noms de domaines (séparés par Espace ou Virgule)
        - Une annonce dit que ces noms de domaine existent déjà. (ref: /etc/letsencrypt/renewal/<monsite.com>.conf)
        - Que veux-tu faire ?
        Choisir option #2 (Renew & replace...)

        1: Keep the existing certificate for now
        2: Renew & replace the cert (limit ~5 per 7 days)

        Et voilà que mon certificat est prolongé de 90 jours.

        service nginx start

        pour clore l'intervention.

      • spider1163

        Merci spider,

        Je pense aussi que mon fichier a disparu....je vais suivre ton conseil.

        Après une réinstallation et la commande ./certbot-auto renew

        Voici le message reçu
        Processing /etc/letsencrypt/renewal/<monsite.com>.conf
        Cert not yet due for renewal

        Mon certificat n'a pas été renouvelé !

        • J'ai fait une recherche du dossier/fichier certbot-auto dans divers dosssier (/home /opt /root ....)

          find /<DOSSIER>/  certbot-auto

          La réponse reste : find: `certbot-auto': No such file or directory

          Possible qu'il ne soit plus présent ?

          • Bonjour
            J'ai un problème pour renouveler le certificat SSL

            service nginx stop
            ./certbot-auto renew
            service nginx start
            

            J'ai ce message d'erreur qui apparaît

            -bash: ./certbot-auto: No such file or directory

            Une petite solution ?

          • dam

            J'ai le même problème.

            Je précise qu'avant la redirection des mails "root" le serveur mail fonctionnait, c'est dès que je rajoute

             root: mon_email@gmail.com 

            ... que je ne reçois plus d'email de confirmation en test.

            À ma 1re installation tout a bien fonctionné, mais à ma 2e (raz) plus du tout.

            • dam a répondu à ça.