Where are all the SSH script commands located in a UNIX environment? I can execute most of them, but ssh-copy-Id is awol.
@rtb , welcome to the forum ! hope you find this to be a friendly and helpful place, and that we are able to guide/assist you in resolving your challenge.
-
what flavor of *nix OS are you using ?
-
what have you done to try and find it ?
-
which ssh related commands have you tried , and where are they located ?
-
what does
man -k ssh
produce on your system ? -
NB: your search will be in vain for ssh-copy-Id , the second last character is an UPPERCASE I not a lowercase i
look forwards to hearing back from you.
hp-ux 11.11
I have searched just about every directory there is for anything starting with ssh.
man -k ssh gives me “/use/share/lib/whatis: No such file or directory
@rtb , are you 100% that you've received the message you say ?
man -k ssh gives me “/use/share/lib/whatis: No such file or directory
I've never encountered directory /use on any *nix distribution
-
I recommend you re-read my initial post - as you have a typo in your command !!!!!!
-
what does
apropos ssh
produce ? -
speak with your sysadmin about getting the manual pages sorted
Hi, this is a follow-up question. Without the use of the ssh-copy-I’d, how can I copy a public RSA key created using ssh-keygen on one Unix server to another Unix server?
I tried ssh-copy-Id and it is also not available.
ssh-copy-Id that's still an UPPERCASE I
Yes that is the message I received from the man command. Btw, I appreciate all the help from you.
Yea, sorry about that. I have tried ssh-copy-id with the same result.
Hello,
Perhaps this is a point to take a step back and ask: are you sure the SSH utilities are actually installed ? It might just be the case that they are not present, and that's why you can't find them.
However, speaking of finding things, do you have locate
or mlocate
installed ? If so, what do you get for the output of:
locate ssh
If you don't have locate
, one last thing you could do here would be the following:
find / -type f -name ssh -print 2>/dev/null
That will trawl the entire system to look for a file called ssh
, if it is present. Watch out though - if you have any NFS filesystems or large database filesystems mounted it will also search those (along with everything else mounted under /), so you may want to limit it to /usr
, /opt
and suchlike rather than starting your search in /.
Lastly: if you are not the original installer or the regular maintainer of this system, can you talk to someone else who also administers your site's HP-UX environment and just ask them if SSH is installed, and if so, where you can find it ?
Hope this helps !
You should always first search your file system as @drysdalk mentioned. There are many elegant ways to do this; here is one quick way which is not elegant at all :
find / | grep bin | grep usr | grep ssh
I just ran this on Ubuntu and you can see some of the results:
ubuntu# find / | grep bin | grep usr | grep ssh
...
...
/usr/sbin/sshd
/usr/bin/sshpass
/usr/bin/ssh-add
/usr/bin/ssh-keyscan
/usr/bin/ssh-keygen
/usr/bin/ssh
/usr/bin/ssh-import-id-gh
/usr/bin/ssh-agent
/usr/bin/ssh-copy-id
/usr/bin/ssh-import-id
/usr/bin/ssh-argv0
/usr/bin/ssh-import-id-lp
@rtb , as you can see, the first step is to locate the files, you can use some elegant way, or you can use some crude way; either way, it takes just a few seconds to locate these files.
Please locate your files, perhaps using a crude method like the one above, and post back the results (using Markdown code tags) and we will take it from there (as @drysdalk always kindly says!)
Also, just ran this for you, as an example, as a normal user on macos:
macos$ find / | grep bin | grep usr | grep ssh
...
...
/usr/bin/ssh-keyscan
/usr/bin/ssh-agent
/usr/bin/ssh
/usr/bin/ssh-add
/usr/bin/ssh-keygen
/usr/bin/ssh-copy-id
/usr/sbin/sshd
...
...
Hope this helps.
This may be correct on HP-UX.
I just checked the HP-UX instructions, and they say you must copy the key over "using any mechanism":
Hence, it is entirely possible that HP-UX does not support ssh-copy-id
out-of-the-box.
https://support.hpe.com/hpesc/public/docDisplay?docId=c02012921&docLocale=en_US
ssh-copy-id is certainly a convenient script, and available in many Linux distros.
So is locate (locate or mlocate package).
You do not need ssh-copy-id.
The task is to copy a remote file (public key) to local. You can use ssh on the accessing host
cd
ssh remotehost "cat .ssh/id_rsa.pub" >> .ssh/authorized_keys
The .ssh/id_rsa.pub you created with ssh-keygen on the remotehost. (The filename and format can differ; usually RSA format is the best.)
Attention: some ssh versions use authorized_keys2
Consult the man pages
man ssh
Last but not least,
/use/share/lib/whatis
is certainly a typo.
Check your MANPATH
echo "$MANPATH"
The MANPATH environment variable is built from system login files and/or the user's shell login files (like .profile).
Thank you for the information. I’ll certainly give it a try sometime soon this week. Should that work, it will be a heavy load off my mine.
Good Morning, Is that ssh command to transfer the public key to the local host to be run on the local host? I ask that because the remote host id is in the ssh command. Also, when I tried that, the only result is a > displayed on the next line after the ssh command. Same result when I tried it on the remote host . And in both cases, the public key was not transferred to the local host.
You do not need to use @MadeInGermany 's example to transfer the file.
You can also sftp
it over and then do a regular ssh
login and copy or move or append the key where you need it to be.
There are myriad ways do accomplish this task. I advise you not to get "hung up" on the specifics of an example, and just move the file / key over and append it as required.
Please note that I already shared a link to HP support which covers this!
https://support.hpe.com/hpesc/public/docDisplay?docId=c02012921&docLocale=en_US
Did you read this very good support page??
Sorry, some magic had split my command in two.
I have edited my post; now it looks correct.
Yes, the accessing host is the local host.
And yes, you can use sftp as well (if configured and enabled in ssd_config).
Thanks for the clarification. I must be jinxed, because after applying the changes from yours and one or two other persons in this thread, nothing worked. I am a beginner in this arena, having inherited the work that requires this skill after the only person who knew what to do left the company.
Now to get past this problem with getting the .pub key over to the local server, I went old school. Meaning, I opened the authorized_keys2 file on both servers using vi. I then did a copy and paste from the remote server that had the .pub file created using ssh-keygen, to the local server.
So now when I execute my scp command from the local server to transfer the files over to the remote server, I do not get any key errors.
BUT, I did get a “parameter not set” error I think for the local host because the error message had the local server id in it. So what does this error mean and how do I determine the fix?
Again, thanks for all the help on this.
That's good. Well done.
You must post the exact command you used before you got this error and the exact full (copy-and-paste) error message if you want others to understand your error message.