Announcement

Collapse
No announcement yet.

Reinstall of Ubuntu Server 18.04LTS. 'Permission denied' Error

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [SOLVED] Reinstall of Ubuntu Server 18.04LTS. 'Permission denied' Error

    Here's the latest output with ssh -v [user]@Server IP

    Code:
    mark@AMD-64:/etc/ssh$ ssh -v mark@192.168.1.105
    OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: /etc/ssh/ssh_config line 19: Applying options for *
    debug1: Connecting to 192.168.1.105 [192.168.1.105] port 22.
    debug1: Connection established.
    debug1: identity file /home/mark/.ssh/id_rsa type -1
    debug1: identity file /home/mark/.ssh/id_rsa-cert type -1
    debug1: identity file /home/mark/.ssh/id_dsa type -1
    debug1: identity file /home/mark/.ssh/id_dsa-cert type -1
    debug1: identity file /home/mark/.ssh/id_ecdsa type -1
    debug1: identity file /home/mark/.ssh/id_ecdsa-cert type -1
    debug1: identity file /home/mark/.ssh/id_ed25519 type -1
    debug1: identity file /home/mark/.ssh/id_ed25519-cert type -1
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.11
    debug1: Remote protocol version 2.0, remote software version dropbear_2013.60
    debug1: no match: dropbear_2013.60
    debug1: SSH2_MSG_KEXINIT sent
    debug1: SSH2_MSG_KEXINIT received
    debug1: kex: server->client aes128-ctr hmac-md5 none
    debug1: kex: client->server aes128-ctr hmac-md5 none
    debug1: sending SSH2_MSG_KEXDH_INIT
    debug1: expecting SSH2_MSG_KEXDH_REPLY
    debug1: Server host key: RSA 43:e4:bf:2e:85:ad:08:b2:43:29:5a:7b:e8:39:69:30
    debug1: Host '192.168.1.105' is known and matches the RSA host key.
    debug1: Found key in /home/mark/.ssh/known_hosts:4
    debug1: ssh_rsa_verify: signature correct
    debug1: SSH2_MSG_NEWKEYS sent
    debug1: expecting SSH2_MSG_NEWKEYS
    debug1: SSH2_MSG_NEWKEYS received
    debug1: SSH2_MSG_SERVICE_REQUEST sent
    debug1: SSH2_MSG_SERVICE_ACCEPT received
    debug1: Authentications that can continue: publickey,password
    debug1: Next authentication method: publickey
    debug1: Trying private key: /home/mark/.ssh/id_rsa
    debug1: Trying private key: /home/mark/.ssh/id_dsa
    debug1: Trying private key: /home/mark/.ssh/id_ecdsa
    debug1: Trying private key: /home/mark/.ssh/id_ed25519
    debug1: Next authentication method: password
    "If you're in a room with another person who sees the world exactly as you do, one of you is redundant." Dr. Steven Covey, The 7-Habits of Highly Effective People

    #2
    Oh sorry, I didn't include the actual error message:

    Code:
    mark@AMD-64:/etc/ssh$ ssh mark@192.168.1.105
    mark@192.168.1.105's password: 
    Permission denied, please try again.
    mark@192.168.1.105's password:
    "If you're in a room with another person who sees the world exactly as you do, one of you is redundant." Dr. Steven Covey, The 7-Habits of Highly Effective People

    Comment


      #3
      And the saga continues. I decided to reinstall again, making sure to carefully type my user name and pw (although I don't believe I was mistyping them). Okay I have a "clean" install.

      1. Activate my two LAN ports by updating the yaml file in /etc/netplan/ so the server has internet access. Okay, ifconfig reports the LAN ports are up and running with static addresses.

      2. ssh into the server and fix the ssh authentication protocol since the server is new and doesn't recognize my client computer. Done.

      3. Get the blkid of the NAS array and update /etc/fstab. While updating the file with nano, the following text starts writing in the file starting at my cursor location: "Broken pipe..." then it kicked me out of nano and the server.

      4. I attempted to ssh back into the server and here's the error message:
      Code:
      mark@AMD-64:/$ ssh mark@192.168.1.105
      The authenticity of host '192.168.1.105 (192.168.1.105)' can't be established.
      RSA key fingerprint is 43:e4:bf:2e:85:ad:08:b2:43:29:5a:7b:e8:39:69:30.
      Are you sure you want to continue connecting (yes/no)? yes
      Warning: Permanently added '192.168.1.105' (RSA) to the list of known hosts.
      mark@192.168.1.105's password: 
      Permission denied, please try again.
      This is the reason I reinstalled the server in the first place and now it's back on a new install. Please help.
      "If you're in a room with another person who sees the world exactly as you do, one of you is redundant." Dr. Steven Covey, The 7-Habits of Highly Effective People

      Comment


        #4
        Anything in this that might be helpful?
        Windows no longer obstructs my view.
        Using Kubuntu Linux since March 23, 2007.
        "It is a capital mistake to theorize before one has data." - Sherlock Holmes

        Comment


          #5
          Snowhog,
          Yes, I implemented the solution the article described and it makes sense. Unfortunately, it does not mention a solution or cause of the "Permission denied, please try again" error that followed. Currently, I am unable to ssh into my server... again.

          Here's my concern, there are numerous posts and articles explaining a myriad of solutions, and I've performed some of them without joy. At what point do the failed solutions start causing problems themselves? It's frustrating that 95% of those solutions are well beyond my current ability to comprehend, let alone undo or reverse when they don't work.

          I know it's somewhat off topic, but are there any Linux online courses for beginner to intermediate Linux users? It would have to be self-paced as most of my time is not my own <smile and sigh> and of course free is always nice, but I'd even go for inexpensive.

          Tutorials, especially on Youtube, I categorize as "temp patches" rather than a learning resource because they show you how to do something... period. What I need is an online classroom environment with theory explained, practice problems to solve, and even a test to take at the end of a section, although testing is probably not necessary. I'm not looking for a certification, although that might be a goal I take on in retirement. I just want to be able to build, run, test, troubleshoot, and do really cool things with *ubuntu.

          If such an online curriculum does not exist, perhaps someone on this forum would like to develop one. If anyone is interested, I've already put significant thought into such a curriculum and the topics that should be covered.

          I own a copy of: A Practical Guide to Ubuntu Linux, Moving to Ubuntu Linux, SSH Mastery, and The Linux Bible. I can read the book and perform the tasks, but it's dry, technical, and written for users (or developers) who already know the system more than I do.

          Okay, I'll stop bitching. After all, the maximum effective range of an excuse is zero meters! Thank you for responding.
          "If you're in a room with another person who sees the world exactly as you do, one of you is redundant." Dr. Steven Covey, The 7-Habits of Highly Effective People

          Comment


            #6
            I am not an expert in this but here‘s what I‘d try next:
            From the error message I can‘t tell if the error message refers to something local or indeed acces to the server. Have you tried establishing a connection from a different device? There are ssh apps for iOS an Android in case you don‘t have a second pc on ypor network.
            If you get through you know your issue is client side, if not maybe the error message is a bit more helpful.

            To make sure ‚permission denied’ does not refer to maybe a leftover ssh file in .ssh which was created while connecting with sudo, how about renaming the .ssh folder and starting all over? Or try sudo ssh mark@…ssh root@…just to see what happens?

            Comment


              #7
              Thomas00, YES! Thanks for the response. I installed Termius on my phone and I CAN ssh into my server. While there, I updated the sources, and edited /etc/fstab. So, with this new information, it's apparent to me that my client computer is the problem, not the server. So I completely removed openssh-client from my computer, rebooted even though I didn't have to and then installed openssh-client from scratch.

              I have the same "Permission denied..." error. I've read several posts by others with this problem. I have yet to see a solution. I have to be able to ssh into my server for the Plex Media Server to work correctly. That's my goal.
              "If you're in a room with another person who sees the world exactly as you do, one of you is redundant." Dr. Steven Covey, The 7-Habits of Highly Effective People

              Comment


                #8
                Originally posted by mhumm2 View Post
                Thomas00, YES! Thanks for the response. I installed Termius on my phone and I CAN ssh into my server. While there, I updated the sources, and edited /etc/fstab. So, with this new information, it's apparent to me that my client computer is the problem, not the server. So I completely removed openssh-client from my computer, rebooted even though I didn't have to and then installed openssh-client from scratch.

                I have the same "Permission denied..." error. I've read several posts by others with this problem. I have yet to see a solution. I have to be able to ssh into my server for the Plex Media Server to work correctly. That's my goal.
                Removal/reinstallation of openssh-client (or any other software) doesn't affect user config files in $HOME, so if the problem is a permission/ownership issue in $HOME/.ssh reinstallation won't help.

                Check the permissions/ownerships of $HOME/.ssh and all files within.
                The directory and all the files should have your user as the owner and group, permissions should be as follows:
                ~/.ssh == 700 (or rwx --- ---)
                private keys (commonly ending with "_rsa") == 600 (or rw- --- ---)
                public keys (*.pub) and other files == 644 (or rw- r-- r--)

                If you are unsure, you can post the output of "ls -la ~/.ssh", and we'll be able to check if there is a problem with permissions/ownerships.

                Comment


                  #9
                  There are only 3 files in the ~/.ssh directory:
                  Code:
                  mark@AMD-64:~/.ssh$ ll
                  total 20
                  drwx------  2 mark mark 4096 Nov 12 18:53 ./
                  drwxr-xr-x 31 mark mark 4096 Nov 15 06:10 ../
                  -rw-rw-r--  1 mark mark   23 Nov 11 13:34 Config
                  -rw-------  1 mark mark  893 Nov 12 18:53 known_hosts
                  -rw-------  1 mark mark  841 Nov 12 18:34 known_hosts.old
                  a file search for *.rsa did not return any private or public keys.
                  "If you're in a room with another person who sees the world exactly as you do, one of you is redundant." Dr. Steven Covey, The 7-Habits of Highly Effective People

                  Comment


                    #10
                    Originally posted by mhumm2 View Post
                    There are only 3 files in the ~/.ssh directory:
                    Code:
                    mark@AMD-64:~/.ssh$ ll
                    total 20
                    drwx------  2 mark mark 4096 Nov 12 18:53 ./
                    drwxr-xr-x 31 mark mark 4096 Nov 15 06:10 ../
                    -rw-rw-r--  1 mark mark   23 Nov 11 13:34 Config
                    -rw-------  1 mark mark  893 Nov 12 18:53 known_hosts
                    -rw-------  1 mark mark  841 Nov 12 18:34 known_hosts.old
                    a file search for *.rsa did not return any private or public keys.
                    Then you probably don't use key based authentication (and use password authentication instead?)...anyway, your permissions/ownerships should be okay (so they are probably not your problem).

                    Not necessarily related, but "Config" should probably be "config" (in case there is some host based configuration in there, it might not get read)
                    Last edited by kubicle; Nov 15, 2018, 08:23 AM.

                    Comment


                      #11
                      Actually kubicle, the file name is "Config" with a capital "C". Oh, I think was another attempted fix from another post I read.
                      Code:
                      mark@AMD-64:~/.ssh$ cat Config
                      ClientAliveInterval 60
                      So I have a question. How do I totally wipeout, reset, start-over, or reconfigure to a starting default before my client and server connected? Is it possible my server has keys (it does btw) and my client does not after removing and reinstalling? I'd be fine just using a username and pw for ssh login because once I have Plex Media Server up and running on my server, I won't need to ssh into it anymore.
                      "If you're in a room with another person who sees the world exactly as you do, one of you is redundant." Dr. Steven Covey, The 7-Habits of Highly Effective People

                      Comment


                        #12
                        Originally posted by mhumm2 View Post
                        Actually kubicle, the file name is "Config" with a capital "C".
                        Not according to the man page:
                        ~/.ssh/config
                        This is the per-user configuration file. The file format and configuration options are described in ssh_config(5). Because of the potential for abuse, this file must have
                        strict permissions: read/write for the user, and not writable by others. It may be group-writable provided that the group in question contains only the user.
                        Originally posted by mhumm2 View Post
                        So I have a question. How do I totally wipeout, reset, start-over, or reconfigure to a starting default before my client and server connected? Is it possible my server has keys (it does btw) and my client does not after removing and reinstalling? I'd be fine just using a username and pw for ssh login because once I have Plex Media Server up and running on my server, I won't need to ssh into it anymore.
                        1. You can purge your openssh packages (not remove, but purge, which will also clean out system wide config files)
                        Code:
                        sudo apt purge <package_name>
                        2. Then delete or rename the ~/.ssh directory (to remove user configuration)
                        3. Reinstall your openssh packages

                        Comment


                          #13
                          I think I may have figured this out. I have 1 desktop computer. It uses discrete power switches that allows me to turn on or off 2 SDDs, a HDD for data, and my optical drive. I select the boot drive (either my everyday OS which is currently 14.04LTS, or my test OS which is currently 18.04LTS) and the computer boots to that OS. Currently only my Bionic Beaver OS can ssh into my server. Trusty continues to error out and I think I know why. I named both Bionic and Trusty as AMD-64. Could this be the issue since the server sees two different AMD-64 clients with the same user name and pw?

                          Since Bionic can ssh into the server, I'm going to change the hostname of my Trusty bootup. I'm hoping the server sees it as a new client computer. I'll report back with the results.
                          "If you're in a room with another person who sees the world exactly as you do, one of you is redundant." Dr. Steven Covey, The 7-Habits of Highly Effective People

                          Comment


                            #14
                            It's been almost a week and I can ssh into my server from both OSs. Thank you to all responders. kubical, interesting about the Config file rather than "config" file. I don't know what happened. Thanks again.
                            "If you're in a room with another person who sees the world exactly as you do, one of you is redundant." Dr. Steven Covey, The 7-Habits of Highly Effective People

                            Comment

                            Working...
                            X