Let me explain...

If you want to log into a remote machine from a local one, and want to use a specific private (!) keyfile locally, > use the -i option. If said keyfile is named id_rsa or whatever crypto stuff was used, and it's contained in the
user's home directory, subdirectory .ssh, the ssh, sftp and scp commands find the file automatically.

This is what I want to do... I've tried to use the -i option to indicate the location of the keys, but I must not have the syntax correct.

I get "Host key verification failed"

So if the key is in /home/biz/.ssh and is called id_rsa, what is the correct syntax for the command line option?

sftp -I /home/biz/.ssh/id_rsa biz@xxxxxxxxxxxxxx did not work



-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Patrik Schindler
Sent: Tuesday, April 29, 2025 2:49 PM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: sFTP User Name - does it need to match user name on the server

Hello Greg,

Am 29.04.2025 um 20:29 schrieb Greg Wilburn <gwilburn@xxxxxxxxxxxxxxxxxxxxxxx>:

I know this goes back a while... but I can't seem to find the "appropriate command line switch" on the SFTP command to point to the public key.

In my case, the key is in /home/biz/.ssh

If I log on as user "biz" I can establish a connection.
If I log on as another user, I cannot connect unless I CHGUSPRF USRPRF(me) HOMEDIR('/home/biz')

I'll be using this in batch... what am I missing?

I'm confused about which direction you're talking. :-)

If you log into a machine via any ssh protocol, the public key is read by the server (job). It is always found in the connecting user's home directory, subdirectory .ssh, file authorized_keys.

If you want to log into a remote machine from a local one, and want to use a specific private (!) keyfile locally, use the -i option. If said keyfile is named id_rsa or whatever crypto stuff was used, and it's contained in the user's home directory, subdirectory .ssh, the ssh, sftp and scp commands find the file automatically. No need to specify -i.

If you want to connect as another user to the remote machine, use username@destination.

Does that help?

:wq! PoC

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Greg Wilburn
Director of IT
301.895.3792 ext. 1231

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.