Want to subscribe to topics you're interested in?
Become a Member

Beta Branch update centmin.sh menu option 21 submenu 1 in 140.00beta01

Discussion in 'Centmin Mod Github Commits' started by eva2000, Jan 5, 2025.

  1. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    12:57 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    update centmin.sh menu option 21 submenu 1 in 140.00beta01

    - update centmin.sh menu option 21 submenu option 1 option 3 for creating new SSH key for remote host. Previously, when it comes time to transfer the new generated SSH key's public key file to the remote host via ssh-copy-id, if the ssh-copy-id process fails, the routine will automatically remove the generated SSH key pairs' private and public key files. This update will improve the routine so that on ssh-copy-id failed transfer, prior to removing the SSH key pairs private and public key files, it will show the contents of both private and public key files. This can save time if you had a temp remote SSH server issue or restriction i.e. firewall or root user SSH restriction on remote host, and you do not want to re-run centmin.sh menu option 21 submenu option 1's option 3 again as you can use the displayed contents to manually recreate the SSH private and public key file contents.

    From centmin.sh menu option 21 submenu option 1

    Code (Text):
    --------------------------------------------------------------
          Manage SSH Keys
    --------------------------------------------------------------
          Uses keygen.sh tool https://github.com/centminmod/keygen
    --------------------------------------------------------------
    1).   List Registered SSH Keys
    2).   Register Existing SSH Keys
    3).   Create New SSH Key For Remote Host
    4).   Use Existing SSH Key For Remote Host
    5).   Rotate Existing SSH Key For Remote Host
    6).   Delete Existing SSH Key For Remote Host
    7).   Export Existing SSH Key
    8).   Backup All Existing SSH Keys
    9).   Back to Main menu
    --------------------------------------------------------------
    Enter option [ 1 - 9 ] 3


    example of updated ssh-copy-id failed routine now showing the SSH key pairs' contents prior to removal

    Code (Text):
    /bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
    Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
    
    ssh-copy-id transfer failed: removing generated SSH key files
    
    remove /root/.ssh/my1.key
    -----BEGIN OPENSSH PRIVATE KEY-----
    b3Blbn*******hhWjq5U7l/kZ1Nx8/04gc6BWjaYqH23F/4IZ
    LYV8RilR6yrdH3IRN1o2AAAACW92aDJpbmtleQECAwQ=
    -----END OPENSSH PRIVATE KEY-----
    remove /root/.ssh/my1.key.pub
    ssh-ed25519 AAAAC3Nz*******1o2 comment



    Continue reading...

    140.00beta01 branch
     
  2. redbird

    redbird Member

    109
    15
    18
    Aug 28, 2015
    Web
    Ratings:
    +29
    Local Time:
    12:57 PM
    Hi can you please provide a more detailed tutorial on how to migrate everything from server a to server b?

    I'm confused with keys. Where you initiate key generation in that case? On server b and then send and save it on server a?

    Please clarify more detailed steps
     
  3. redbird

    redbird Member

    109
    15
    18
    Aug 28, 2015
    Web
    Ratings:
    +29
    Local Time:
    12:57 PM
    I think I figured it out but can't migrate data: permission denied.

    The thing is destination server has username other than root by default. When I log in with that username I usually upgrade to root by "sudo su -"

    How to resolve this?
     

    Attached Files:

  4. redbird

    redbird Member

    109
    15
    18
    Aug 28, 2015
    Web
    Ratings:
    +29
    Local Time:
    12:57 PM
    Anyone?
     
  5. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    12:57 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    Which stage or centmin.sh menu option 21 do you get permission denied, data backup or backed up data file transfer and how are you transferring the data? It would help if you specifically output the steps and submenu options you chose and where you got the permission denied messages. With that said, the centmin.sh menu option 21 does assume full root user right now, so if you can provide the info and where you get the issues, I can look at adding sudo user support.


    see https://centminmod.com/menu21-140.00beta01
     
  6. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    12:57 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    Ah the screenshot shows it's during tunnel-transfer.sh script stage. I've just updated Centmin Mod 131.00stable and 140.00beta01 with fixes to support sudo user on transfers. Run cmupdate to get the latest fix and then it should work, let me know.

    If you do not want to re-run entire backup, just re-run that screenshot's command exactly and it should work provided remote server's non-root sudo user was setup correctly.