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 - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-19-2019, 07:23 PM   #16
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Original Poster
Rep: Reputation: 73

Fixed it!

goDaddy wants rsa keys!

In the beginning I was recommended to use ed25519 because that will replace other key types in future.

This line in the debug gave me the idea to make rsa keys.

Quote:
debug1: Server host certificate: ssh-rsa-cert-v01@openssh.com SHA256:HRNiV8mP/erMipONmcEcpBEqYGX4LE7RpOQdhmA2hXg, serial 0 ID "sg3plcpnl0194" CA ssh-rsa SHA256:/rQIvLr7xvz+/zIt0O2xP7rRFMu+0lLV1w1FJNQZRco valid forever
Now I can sftp and get the files I want automatically.

Last edited by Pedroski; 06-19-2019 at 07:39 PM.
 
1 members found this post helpful.
Old 06-19-2019, 10:07 PM   #17
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
Interesting. It seems they might be modifying the keys into certificates. If you ever find out more, it would be great to know what is going on there.
 
Old 06-20-2019, 05:38 AM   #18
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Original Poster
Rep: Reputation: 73
Thanks for your help!

I successfully used sftp to collect files, download them, then delete them on the server. Exactly what I wanted!

So simple, I am still amazed! I will need this next term.

If, and only if, you have time:

I'd like to know what this line you gave me does:

Quote:
sed -i.bak 's/^/command="internal-sftp" /;q' ~/.ssh/webpage_ed25519_key.pub
 
Old 06-20-2019, 05:55 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
Sure. You can compare ~/.ssh/webpage_ed25519_key.pub and ~/.ssh/webpage_ed25519_key.pub.bak

All that sed script does is prepend command="internal-sftp" to the public key, while keeping a backup copy. The -i.bak renames the original by appending .bak to the name. The pattern ^ is an anchor to the beginning of the line. s/// is, of course, the substitute command. I figured it was less complicated than saying to find any method you like to prepend command="internal-sftp" to the public key.

So if the public key was like this before:
Code:
ssh-ed25519 AAAAC3NzaC1lZDI1N ... oDZmcveerQq53dm/o9j pedroski's sftp login
Then it will be like this afterwards:
Code:
command="internal-sftp" ssh-ed25519 AAAAC3NzaC1lZDI1N ... oDZmcveerQq53dm/o9j pedroski's sftp login
And what that does is make that key usable only for SFTP as a first step in locking it down. If the authorized_keys file on the remote server is accessible then it can be replaced. But if nothing else, it adds an extra step for anyone who has succeeded in stealing the key.

See the manual page for sed and http://www.grymoire.com/Unix/Sed.html
 
  


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
LXer: Why Microsoft's Linux lovefest goes hand-in-hand with its Azure cloud strategy LXer Syndicated Linux News 0 07-17-2016 07:06 PM
SFTP using another account with passwordless sftp access jobart08 Linux - Newbie 3 03-23-2016 06:14 AM
cannot login into SFTP server using Net::SFTP cccc Programming 1 10-31-2007 06:23 AM
LXer: Linux Training and Laptops Go Hand in Hand at LinuxCertified LXer Syndicated Linux News 0 01-31-2006 12:01 PM
Files truncated by sftp/sftp-server at 65kb gato Linux - Networking 1 12-18-2003 10:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:03 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