LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-16-2016, 09:33 AM   #16
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,307
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721

There are several key types. Ed25519 is one of the new ones, and considered quite sound. Check the manual page for ssh-keygen for what's available on your particular systems. DSA should be avoided now, even if it might still be available. If you don't have ed25519 or you have a dongle that requires RSA, then RSA is a good fallback.
 
Old 12-16-2016, 09:34 AM   #17
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Using a EdDSA key instead of dsa or rsa

https://en.wikipedia.org/wiki/EdDSA

I'm having a bad day...
 
Old 12-16-2016, 09:45 AM   #18
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
I used ssh, but it still asks for a password
 
Old 12-16-2016, 09:47 AM   #19
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,307
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
Can you show the command you used to create the key? And the command you used to upload it to the server? And, finally, the command you used to try to use the key when connecting with ssh or scp?
 
Old 12-16-2016, 10:07 AM   #20
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
to create the key - ssh-keygen
to upload it to the server - ssh-copy-id username@hostname
to connect using ssh - ssh username@hostname
 
Old 12-16-2016, 10:21 AM   #21
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
I have 3 files in .ssh directory, id_rsa, id_rsa.pub and known_hosts. Is any of these suppose to be in the command?
 
Old 12-16-2016, 10:24 AM   #22
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,307
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
Quote:
Originally Posted by trickydba View Post
to create the key - ssh-keygen
to upload it to the server - ssh-copy-id username@hostname
to connect using ssh - ssh username@hostname
The first two are ok, though I prefer ed25519 over RSA myself. ssh-keygen defaults to RSA.

However, with that last line, you need to tell ssh which key to use, even if there is only one.

Code:
ssh -i ~/.ssh/id_rsa username@hostname
See the manual page man ssh for the details on -i
 
Old 12-16-2016, 10:30 AM   #23
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
Did that..........still asks for a password
 
Old 12-16-2016, 10:44 AM   #24
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,307
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
Quote:
Originally Posted by trickydba View Post
Did that..........still asks for a password
Ok. On the server, check the permissions and make sure that no other users besides yourself have write access to .ssh or the directories above it:

Code:
stat -c "%U %G %a" /home/
stat -c "%U %G %a" /home/trickydba/
stat -c "%U %G %a" /home/trickydba/.ssh/
stat -c "%U %G %a" /home/trickydba/.ssh/authorized_keys
The directory .ssh should have permissions of 700.

Do you have access on the server to track the logs from sshd?

Last edited by Turbocapitalist; 12-16-2016 at 12:10 PM. Reason: on the server...
 
Old 12-16-2016, 10:58 AM   #25
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Is the server configured for public key authentication?

ssh defaults to ~/.ssh/id_rsa so it isn't necessary to specify it with the -i unless it is different.

Last edited by michaelk; 12-16-2016 at 10:59 AM.
 
Old 12-16-2016, 11:54 AM   #26
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
This whole process works in PowerShell(YUCK!) but I LOVE linux and want to do it in linux. I noticed in the Powershell script it actually passes the host key. I'd rather do this in linux but this is a very big struggle for me, I've been on this at work and even at home for HOURS!!!!!
 
Old 12-16-2016, 01:16 PM   #27
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
I solved it using previous code mentioned:

scp -p filename*.xlsx filename2*.xlsx username@hostname://dir/dir2

but this is for files WITHOUT the appended current date using Expect. Hey it works.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete/move/copy files of specific date imsajjadali Red Hat 26 11-07-2013 11:34 PM
Bash script help - Capture output of ls - move files according to date wayneywoo Programming 5 04-23-2013 08:45 AM
move files based on date graphicsmanx1 Programming 7 12-18-2012 01:49 AM
[SOLVED] Bash script to move files from date cbing Programming 9 04-20-2012 05:45 AM
"How to rename files with current date stamp appended into name using shell script?" nandi Linux - Newbie 4 10-05-2011 10:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration