Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
Hello, I need to connect to a linux server using a linux box. 1. The server does not require a password. It is locked down by IP. 2. It requires ...
  1. #1
    Just Joined!
    Join Date
    Aug 2010
    Posts
    27

    Guidance For SSH

    Hello,
    I need to connect to a linux server using a linux box.

    1. The server does not require a password. It is locked down by IP.
    2. It requires a public key/private key.
    3. The linux box I was given has .ssh and .gnupg directory with files in them.

    What should I do?

    This is what I am thinking:
    1. Delete everything from .ssh and gnupg directories.
    2. Generate new key:
    Code:
    ssh-keygen -t rsa -C "me(at)gmail.com"
    3. Give the public key to the server admin.
    4. Then try to connect.
    I don't know what command to use when trying to connect. I don't think the normal
    Code:
    ssh me(at)X.X.X.X
    would work. What should I type to specify that there is a private key and that I need to connect using port 1901?

    Any input would be highly appreciated. Many thanks in advance.

  2. #2
    Linux User Manko10's Avatar
    Join Date
    Sep 2010
    Posts
    250
    When your certificate is in your .ssh folder you can connect with just ssh -p 1901 user@server. The certificate is chosen automatically for you.
    Refining Linux Advent calendar: “24 Outstanding ZSH Gems

  3. #3
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    You do not need to delete the other stuff in ~/.ssh.

    The pulic key needs to be added to ~/.ssh/authorized_keys on the server, for example, once the generated public key file is on the server, you could do
    Code:
    cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
    Connect to the server on port 1901
    Code:
    ssh -p 1901 user@serveraddress.com

  4. #4
    Just Joined!
    Join Date
    Aug 2010
    Posts
    27
    Thanks for your fast reply.

    Unfortunately, it's not working.

    I don't have a ~/id_rsa.pub. Note that this was originally someone else's machine.

    I get prompted for a password if I do:
    ssh -p 1901 user(at)serveraddress(dot)com

    There is no password. I can login fine without any password using putty from windows.
    If I don't enter a password I end up with following error:
    Permission denied (publickey,gssapi-with-mic,password).

    Your kind advice would be very much appreciated.

  5. #5
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    the .pub file is created when you generate the public/private keys on your client machine.

    Code:
    ssh-keygen -t rsa

  6. #6
    Just Joined!
    Join Date
    Aug 2010
    Posts
    27
    So, If I skip step one and do the rest I should be okay right?

  7. #7
    Just Joined!
    Join Date
    Aug 2010
    Posts
    27
    Okay. This is starting to make sense to me.
    In my ~/.ssh directory I already have the following files:
    Code:
    authorized_keys  id_rsa  id_rsa.pub  known_hosts
    Do I still need to make a new key?

  8. #8
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    Are you files you created with ssh-keygen? If they were already there, I would probably generate a new pair. Depends how paranoid you are that someone else could have the private key.

  9. #9
    Just Joined!
    Join Date
    Aug 2010
    Posts
    27
    I inherited this computer from someone else. I do not know what he did.
    Should I just delete everything and start over?

  10. #10
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    That's up to you, but there's no harm in removing various config files in your home directory. It just resets things to the default.

    I would personally create my own user account on the machine and delete the old one, but again, up to you.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...