Equivalent of âssh-keyscan -Hâ in Solaris 10/11

Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I'm creating a Perl program that adds the specified host in root's known_hosts file. The program works in AIX and Linux, but not in Solaris and sadly, I can't find its equivalent command.
Sample line:
system("ssh-keyscan -H www.myserver.domain >> /.ssh/known_hosts");
Output:
ssh-keyscan: illegal option -- H
Usage: ssh-keyscan [-v46] [-p port] [-T timeout] [-f file]
[host | addrlist namelist] [...]
Update 1:
I tried the following command but it still asks for authenticity:
system("ssh-keyscan -t rsa www.myserver.domain >> /.ssh/known_hosts");
Update 2:
Output outside Perl:
# ssh-keyscan -t rsa www.myserver.domain >> /.ssh/test123.text
# www.myserver.domain SSH-2.0-OpenSSH_6.7p1 Debian-5+deb8u3
# less test123.text
# www.myserver.domain ssh-rsa KEY
# ssh www.myserver.domain
# The authenticity of host 'www.myserver.domain (IP)' can't be established. RSA key fingerprint is FINGERPRINT. Are you sure you want to continue connecting (yes/no)?
perl solaris
add a comment |Â
up vote
1
down vote
favorite
I'm creating a Perl program that adds the specified host in root's known_hosts file. The program works in AIX and Linux, but not in Solaris and sadly, I can't find its equivalent command.
Sample line:
system("ssh-keyscan -H www.myserver.domain >> /.ssh/known_hosts");
Output:
ssh-keyscan: illegal option -- H
Usage: ssh-keyscan [-v46] [-p port] [-T timeout] [-f file]
[host | addrlist namelist] [...]
Update 1:
I tried the following command but it still asks for authenticity:
system("ssh-keyscan -t rsa www.myserver.domain >> /.ssh/known_hosts");
Update 2:
Output outside Perl:
# ssh-keyscan -t rsa www.myserver.domain >> /.ssh/test123.text
# www.myserver.domain SSH-2.0-OpenSSH_6.7p1 Debian-5+deb8u3
# less test123.text
# www.myserver.domain ssh-rsa KEY
# ssh www.myserver.domain
# The authenticity of host 'www.myserver.domain (IP)' can't be established. RSA key fingerprint is FINGERPRINT. Are you sure you want to continue connecting (yes/no)?
perl solaris
What's the version ofssh-keyscanyou're using on Solaris?
â slmâ¦
Aug 15 at 2:12
How do I find out the version of ssh-keyscan?
â Shan
Aug 15 at 2:19
Can't tell, doesn't appear to display a version.
â slmâ¦
Aug 15 at 2:21
If you are root (as appears) and your homedir is in fact the rootdir, look at/.ssh/known_hostsand make sure a line for the desired host is in there, then tryssh -v $hostnameand look at the logged output.
â dave_thompson_085
Aug 15 at 6:23
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm creating a Perl program that adds the specified host in root's known_hosts file. The program works in AIX and Linux, but not in Solaris and sadly, I can't find its equivalent command.
Sample line:
system("ssh-keyscan -H www.myserver.domain >> /.ssh/known_hosts");
Output:
ssh-keyscan: illegal option -- H
Usage: ssh-keyscan [-v46] [-p port] [-T timeout] [-f file]
[host | addrlist namelist] [...]
Update 1:
I tried the following command but it still asks for authenticity:
system("ssh-keyscan -t rsa www.myserver.domain >> /.ssh/known_hosts");
Update 2:
Output outside Perl:
# ssh-keyscan -t rsa www.myserver.domain >> /.ssh/test123.text
# www.myserver.domain SSH-2.0-OpenSSH_6.7p1 Debian-5+deb8u3
# less test123.text
# www.myserver.domain ssh-rsa KEY
# ssh www.myserver.domain
# The authenticity of host 'www.myserver.domain (IP)' can't be established. RSA key fingerprint is FINGERPRINT. Are you sure you want to continue connecting (yes/no)?
perl solaris
I'm creating a Perl program that adds the specified host in root's known_hosts file. The program works in AIX and Linux, but not in Solaris and sadly, I can't find its equivalent command.
Sample line:
system("ssh-keyscan -H www.myserver.domain >> /.ssh/known_hosts");
Output:
ssh-keyscan: illegal option -- H
Usage: ssh-keyscan [-v46] [-p port] [-T timeout] [-f file]
[host | addrlist namelist] [...]
Update 1:
I tried the following command but it still asks for authenticity:
system("ssh-keyscan -t rsa www.myserver.domain >> /.ssh/known_hosts");
Update 2:
Output outside Perl:
# ssh-keyscan -t rsa www.myserver.domain >> /.ssh/test123.text
# www.myserver.domain SSH-2.0-OpenSSH_6.7p1 Debian-5+deb8u3
# less test123.text
# www.myserver.domain ssh-rsa KEY
# ssh www.myserver.domain
# The authenticity of host 'www.myserver.domain (IP)' can't be established. RSA key fingerprint is FINGERPRINT. Are you sure you want to continue connecting (yes/no)?
perl solaris
perl solaris
edited Sep 7 at 10:05
Rui F Ribeiro
36.6k1271116
36.6k1271116
asked Aug 15 at 2:11
Shan
63
63
What's the version ofssh-keyscanyou're using on Solaris?
â slmâ¦
Aug 15 at 2:12
How do I find out the version of ssh-keyscan?
â Shan
Aug 15 at 2:19
Can't tell, doesn't appear to display a version.
â slmâ¦
Aug 15 at 2:21
If you are root (as appears) and your homedir is in fact the rootdir, look at/.ssh/known_hostsand make sure a line for the desired host is in there, then tryssh -v $hostnameand look at the logged output.
â dave_thompson_085
Aug 15 at 6:23
add a comment |Â
What's the version ofssh-keyscanyou're using on Solaris?
â slmâ¦
Aug 15 at 2:12
How do I find out the version of ssh-keyscan?
â Shan
Aug 15 at 2:19
Can't tell, doesn't appear to display a version.
â slmâ¦
Aug 15 at 2:21
If you are root (as appears) and your homedir is in fact the rootdir, look at/.ssh/known_hostsand make sure a line for the desired host is in there, then tryssh -v $hostnameand look at the logged output.
â dave_thompson_085
Aug 15 at 6:23
What's the version of
ssh-keyscan you're using on Solaris?â slmâ¦
Aug 15 at 2:12
What's the version of
ssh-keyscan you're using on Solaris?â slmâ¦
Aug 15 at 2:12
How do I find out the version of ssh-keyscan?
â Shan
Aug 15 at 2:19
How do I find out the version of ssh-keyscan?
â Shan
Aug 15 at 2:19
Can't tell, doesn't appear to display a version.
â slmâ¦
Aug 15 at 2:21
Can't tell, doesn't appear to display a version.
â slmâ¦
Aug 15 at 2:21
If you are root (as appears) and your homedir is in fact the rootdir, look at
/.ssh/known_hosts and make sure a line for the desired host is in there, then try ssh -v $hostname and look at the logged output.â dave_thompson_085
Aug 15 at 6:23
If you are root (as appears) and your homedir is in fact the rootdir, look at
/.ssh/known_hosts and make sure a line for the desired host is in there, then try ssh -v $hostname and look at the logged output.â dave_thompson_085
Aug 15 at 6:23
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
Looking at the man page for ssh-keyscan on Solaris 10/11 doesn't look to support that switch.
Reference: ssh-keyscan man page
ssh-keyscan [-v46] [-p port] [-T timeout] [-t type]
[-f file] [-] [host... | addrlist namelist] [...]
I think you can just do ssh-keyscan <hostname> however to retrieve the keys and then write them to your ~/.ssh/known_hosts file. This will still work but just won't put all the names that the host goes by on a single line like this:
hostname1, hostname1.fqdn.com .....
So you might have some cleanup work to do on the resulting known_hosts file.
Host authenticity
If you find you're encountering this issue which amounts to a catch 22, where you cannot scan a host that's not yet present in your known_hosts file:
The authenticity of host 'www.myserver.domain (IP)' can't be established. RSA key fingerprint is FINGERPRINT. Are you sure you want to continue connecting (yes/no)?
You can work around this issue by temporarily disabling StrictHostKeyChecking:
$ cat ~/.ssh/config
...
StrictHostKeyChecking no
...
Then do your keyscan <host> ... command again. Once you're complete, be sure to remove the StrictHostKeyChecking from your ~/.ssh/config.
References
- ssh_config man page
@Shan - what happens if you sayyat that prompt?
â slmâ¦
Aug 15 at 11:42
host will be added to the list of known_hosts (not recommended; I need to automate this)
â Shan
Aug 16 at 2:08
@Shan - see updates.
â slmâ¦
Aug 16 at 3:17
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Looking at the man page for ssh-keyscan on Solaris 10/11 doesn't look to support that switch.
Reference: ssh-keyscan man page
ssh-keyscan [-v46] [-p port] [-T timeout] [-t type]
[-f file] [-] [host... | addrlist namelist] [...]
I think you can just do ssh-keyscan <hostname> however to retrieve the keys and then write them to your ~/.ssh/known_hosts file. This will still work but just won't put all the names that the host goes by on a single line like this:
hostname1, hostname1.fqdn.com .....
So you might have some cleanup work to do on the resulting known_hosts file.
Host authenticity
If you find you're encountering this issue which amounts to a catch 22, where you cannot scan a host that's not yet present in your known_hosts file:
The authenticity of host 'www.myserver.domain (IP)' can't be established. RSA key fingerprint is FINGERPRINT. Are you sure you want to continue connecting (yes/no)?
You can work around this issue by temporarily disabling StrictHostKeyChecking:
$ cat ~/.ssh/config
...
StrictHostKeyChecking no
...
Then do your keyscan <host> ... command again. Once you're complete, be sure to remove the StrictHostKeyChecking from your ~/.ssh/config.
References
- ssh_config man page
@Shan - what happens if you sayyat that prompt?
â slmâ¦
Aug 15 at 11:42
host will be added to the list of known_hosts (not recommended; I need to automate this)
â Shan
Aug 16 at 2:08
@Shan - see updates.
â slmâ¦
Aug 16 at 3:17
add a comment |Â
up vote
0
down vote
Looking at the man page for ssh-keyscan on Solaris 10/11 doesn't look to support that switch.
Reference: ssh-keyscan man page
ssh-keyscan [-v46] [-p port] [-T timeout] [-t type]
[-f file] [-] [host... | addrlist namelist] [...]
I think you can just do ssh-keyscan <hostname> however to retrieve the keys and then write them to your ~/.ssh/known_hosts file. This will still work but just won't put all the names that the host goes by on a single line like this:
hostname1, hostname1.fqdn.com .....
So you might have some cleanup work to do on the resulting known_hosts file.
Host authenticity
If you find you're encountering this issue which amounts to a catch 22, where you cannot scan a host that's not yet present in your known_hosts file:
The authenticity of host 'www.myserver.domain (IP)' can't be established. RSA key fingerprint is FINGERPRINT. Are you sure you want to continue connecting (yes/no)?
You can work around this issue by temporarily disabling StrictHostKeyChecking:
$ cat ~/.ssh/config
...
StrictHostKeyChecking no
...
Then do your keyscan <host> ... command again. Once you're complete, be sure to remove the StrictHostKeyChecking from your ~/.ssh/config.
References
- ssh_config man page
@Shan - what happens if you sayyat that prompt?
â slmâ¦
Aug 15 at 11:42
host will be added to the list of known_hosts (not recommended; I need to automate this)
â Shan
Aug 16 at 2:08
@Shan - see updates.
â slmâ¦
Aug 16 at 3:17
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Looking at the man page for ssh-keyscan on Solaris 10/11 doesn't look to support that switch.
Reference: ssh-keyscan man page
ssh-keyscan [-v46] [-p port] [-T timeout] [-t type]
[-f file] [-] [host... | addrlist namelist] [...]
I think you can just do ssh-keyscan <hostname> however to retrieve the keys and then write them to your ~/.ssh/known_hosts file. This will still work but just won't put all the names that the host goes by on a single line like this:
hostname1, hostname1.fqdn.com .....
So you might have some cleanup work to do on the resulting known_hosts file.
Host authenticity
If you find you're encountering this issue which amounts to a catch 22, where you cannot scan a host that's not yet present in your known_hosts file:
The authenticity of host 'www.myserver.domain (IP)' can't be established. RSA key fingerprint is FINGERPRINT. Are you sure you want to continue connecting (yes/no)?
You can work around this issue by temporarily disabling StrictHostKeyChecking:
$ cat ~/.ssh/config
...
StrictHostKeyChecking no
...
Then do your keyscan <host> ... command again. Once you're complete, be sure to remove the StrictHostKeyChecking from your ~/.ssh/config.
References
- ssh_config man page
Looking at the man page for ssh-keyscan on Solaris 10/11 doesn't look to support that switch.
Reference: ssh-keyscan man page
ssh-keyscan [-v46] [-p port] [-T timeout] [-t type]
[-f file] [-] [host... | addrlist namelist] [...]
I think you can just do ssh-keyscan <hostname> however to retrieve the keys and then write them to your ~/.ssh/known_hosts file. This will still work but just won't put all the names that the host goes by on a single line like this:
hostname1, hostname1.fqdn.com .....
So you might have some cleanup work to do on the resulting known_hosts file.
Host authenticity
If you find you're encountering this issue which amounts to a catch 22, where you cannot scan a host that's not yet present in your known_hosts file:
The authenticity of host 'www.myserver.domain (IP)' can't be established. RSA key fingerprint is FINGERPRINT. Are you sure you want to continue connecting (yes/no)?
You can work around this issue by temporarily disabling StrictHostKeyChecking:
$ cat ~/.ssh/config
...
StrictHostKeyChecking no
...
Then do your keyscan <host> ... command again. Once you're complete, be sure to remove the StrictHostKeyChecking from your ~/.ssh/config.
References
- ssh_config man page
edited Aug 16 at 3:16
answered Aug 15 at 2:14
slmâ¦
238k65492662
238k65492662
@Shan - what happens if you sayyat that prompt?
â slmâ¦
Aug 15 at 11:42
host will be added to the list of known_hosts (not recommended; I need to automate this)
â Shan
Aug 16 at 2:08
@Shan - see updates.
â slmâ¦
Aug 16 at 3:17
add a comment |Â
@Shan - what happens if you sayyat that prompt?
â slmâ¦
Aug 15 at 11:42
host will be added to the list of known_hosts (not recommended; I need to automate this)
â Shan
Aug 16 at 2:08
@Shan - see updates.
â slmâ¦
Aug 16 at 3:17
@Shan - what happens if you say
y at that prompt?â slmâ¦
Aug 15 at 11:42
@Shan - what happens if you say
y at that prompt?â slmâ¦
Aug 15 at 11:42
host will be added to the list of known_hosts (not recommended; I need to automate this)
â Shan
Aug 16 at 2:08
host will be added to the list of known_hosts (not recommended; I need to automate this)
â Shan
Aug 16 at 2:08
@Shan - see updates.
â slmâ¦
Aug 16 at 3:17
@Shan - see updates.
â slmâ¦
Aug 16 at 3:17
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f462656%2fequivalent-of-ssh-keyscan-h-in-solaris-10-11%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
What's the version of
ssh-keyscanyou're using on Solaris?â slmâ¦
Aug 15 at 2:12
How do I find out the version of ssh-keyscan?
â Shan
Aug 15 at 2:19
Can't tell, doesn't appear to display a version.
â slmâ¦
Aug 15 at 2:21
If you are root (as appears) and your homedir is in fact the rootdir, look at
/.ssh/known_hostsand make sure a line for the desired host is in there, then tryssh -v $hostnameand look at the logged output.â dave_thompson_085
Aug 15 at 6:23