Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20

Thread: How to get a file from server using command prompt

  1. #11
    Join Date
    Sep 2012
    Location
    Guntur
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to get a file from server using command prompt

    Quote Originally Posted by Lars Noodén View Post
    To get a file without the password, you'll have to set up a web server or an Anonymous FTP server and then put the file in the directory that is published by the server. Apache is by far the most common web server, but nginx is gaining in popularity.
    how can i do that any INSTRUCTIONS?? please

  2. #12
    Join Date
    Jan 2008
    Location
    Manchester UK
    Beans
    13,573
    Distro
    Ubuntu

    Re: How to get a file from server using command prompt

    The best way to do that would be to set up keys

    From your local machine

    Code:
    ssh-keygen
    You can enter through the passphrase bit because if you use a passphrase then you will have to type it which defeats the object. Then

    Code:
    ssh-copy-id mohan@ip.address.of.server
    You will have to type the servers password this time but after that you won't.

  3. #13
    Join Date
    Sep 2012
    Location
    Guntur
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to get a file from server using command prompt

    Quote Originally Posted by nothingspecial View Post
    The best way to do that would be to set up keys

    From your local machine

    Code:
    ssh-keygen
    You can enter through the passphrase bit because if you use a passphrase then you will have to type it which defeats the object. Then

    Code:
    ssh-copy-id mohan@ip.address.of.server
    You will have to type the servers password this time but after that you won't.
    i tried this but is it correct??
    Code:
    ssh-keygen
    Generating public/private rsa key pair.
    Enter file in which to save the key (/home/krishna/.ssh/id_rsa): 
    Enter passphrase (empty for no passphrase): 
    Enter same passphrase again: 
    Your identification has been saved in /home/krishna/.ssh/id_rsa.
    Your public key has been saved in /home/krishna/.ssh/id_rsa.pub.
    The key fingerprint is:
    bc:27:80:fb:8c:5c:d0:46:18:0d:94:c8:27:d0:37:17 krishna@ubuntu
    The key's randomart image is:
    +--[ RSA 2048]----+
    |.+ o++E.         |
    |  = =oo          |
    |   +.o.          |
    |     + .         |
    |    o + S        |
    |     + . .       |
    |    . . o .      |
    |   . =   o       |
    |    o o          |
    +-----------------+

  4. #14
    Join Date
    Jan 2008
    Location
    Manchester UK
    Beans
    13,573
    Distro
    Ubuntu

    Re: How to get a file from server using command prompt

    yep, that looks good. Then

    Code:
    ssh-copy-id mohan@192.168.?.?
    or what ever the ip address is.

  5. #15
    Join Date
    Sep 2012
    Location
    Guntur
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to get a file from server using command prompt

    Quote Originally Posted by nothingspecial View Post
    yep, that looks good. Then

    Code:
    ssh-copy-id mohan@192.168.?.?
    or what ever the ip address is.
    This is what the output is

    Code:
     ssh-copy-id mohan@10.40.70.68
    mohan@10.40.70.68's password: 
    Now try logging into the machine, with "ssh 'mohan@10.40.70.68'", and check in:
    
      ~/.ssh/authorized_keys
    
    to make sure we haven't added extra keys that you weren't expecting.
    what should i do after this?

  6. #16
    Join Date
    Jan 2008
    Location
    Manchester UK
    Beans
    13,573
    Distro
    Ubuntu

    Re: How to get a file from server using command prompt

    That's right.

    You should now be able to login or scp from that server without a password.

  7. #17
    Join Date
    Sep 2012
    Location
    Guntur
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to get a file from server using command prompt

    Quote Originally Posted by nothingspecial View Post
    That's right.

    You should now be able to login or scp from that server without a password.
    so can i download the file without being prompted for the password??
    Last edited by Mohan1289; November 26th, 2012 at 11:13 AM.

  8. #18
    Join Date
    Jan 2008
    Location
    Manchester UK
    Beans
    13,573
    Distro
    Ubuntu

    Re: How to get a file from server using command prompt

    yep

  9. #19
    Join Date
    Sep 2012
    Location
    Guntur
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to get a file from server using command prompt

    Quote Originally Posted by nothingspecial View Post
    yep

    Thank you it's downloaded automatically thank you.. can you please explain me the use of ssh-keygen and then copying the id?

  10. #20
    Join Date
    Jan 2008
    Location
    Manchester UK
    Beans
    13,573
    Distro
    Ubuntu

    Re: How to get a file from server using command prompt

    You are creating a pair of keys. You send one to the server and you have one on your local machine. When you attempt to connect to the server via ssh (which includes scp) the server asks if you have a key. You show it your key and it checks it against the one you sent it. Because they match up, the server knows it's you and lets you in ...........


    ........ sort of.

    Keys are generated with fancy random maths stuff and are much more secure than passwords. There is some information on the wiki

    https://help.ubuntu.com/community/SSH/OpenSSH/Keys

    Somewhere on this forum is a very good analogy that explains gpg, keys and all this stuff really well but I can't find it right now.

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

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