Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to
LinuxQuestions.org , a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free.
Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please
contact us . If you need to reset your password,
click here .
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a
virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month.
Click here for more info.
09-18-2008, 11:40 AM
#1
Member
Registered: May 2007
Posts: 100
Rep:
using TCP to do ssh connections within an app
Hi ,
I have the following scenario I am using telnet <localhost> port number
and this works fine over TCP sockets within the my application.
I want to be able to do similar with ssh
ssh <localhost> -p portnumber
I can get connected but it appears it's not listening or receiving requests
do I need anything to enable ssh I did a snoop on it and it looks like ther is traffic been ack.
Anyone have any ideas what i need to get the ssh to WORK ?
Thanks
09-18-2008, 01:43 PM
#2
Member
Registered: Oct 2006
Location: Kenya
Distribution: Ubuntu, RHEL, OpenBSD
Posts: 287
Rep:
Quote:
I can get connected but it appears it's not listening or receiving requests
Does this mean you can or cannot connect? Do you want to see the actual traffic? I might have missed something.
09-18-2008, 03:54 PM
#3
Member
Registered: May 2007
Posts: 100
Original Poster
Rep:
it appears to be connected when i run snoop on the port number i can see some activity but the problem is that when i write to the socket it just hangs till i do ctrl c and then disconnects ...
Do you know do i have to set anything different than the telnet connection ??????????????????????????????????????
the telnet call works fine.
09-18-2008, 08:33 PM
#4
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,358
Can you login manually via ssh and run a cmd eg ls on the remote box?
If not, add 1, 2 or 3 -v options to the cmd to enable debugging.
09-18-2008, 09:39 PM
#5
Member
Registered: Oct 2006
Location: Kenya
Distribution: Ubuntu, RHEL, OpenBSD
Posts: 287
Rep:
Perhaps your ssh.config needs abit of tweaking but may be you might want to run what chrism01 suggested. Paste your results here.
09-19-2008, 03:17 AM
#6
Member
Registered: May 2007
Posts: 100
Original Poster
Rep:
I don't have a config file in .ssh home directory?
What do i need to in here .
all I have is my private key in the .ssh directory
Thanks
output from ssh <hostname> -v
Sun_SSH_1.1, SSH protocols 1.5/2.0, OpenSSL 0x0090704f
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Rhosts Authentication disabled, originating port will not be trusted.
debug1: ssh_connect: needpriv 0
debug1: Connecting to billc [10.0.3.1] port 22.
debug1: Connection established.
debug1: identity file /home/t/.ssh/identity type -1
debug1: identity file /home/t/.ssh/id_rsa type 1
debug1: identity file /home/t/.ssh/id_dsa type 2
debug1: Remote protocol version 2.0, remote software version Sun_SSH_1.1
debug1: no match: Sun_SSH_1.1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-Sun_SSH_1.1
debug1: Failed to acquire GSS-API credentials for any mechanisms (No credentials were supplied, or the credentials were unavailable or inaccessible
Unknown code 0
)
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: Peer sent proposed langtags, ctos: fr,fr-BE,fr-FR,en-GB,en-IE,nl,nl-BE,nl-NL,i-default
debug1: Peer sent proposed langtags, stoc: fr,fr-BE,fr-FR,en-GB,en-IE,nl,nl-BE,nl-NL,i-default
debug1: We proposed langtags, ctos: i-default
debug1: We proposed langtags, stoc: i-default
debug1: Negotiated lang: i-default
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: Remote: Negotiated main locale: C
debug1: Remote: Negotiated messages locale: C
debug1: dh_gen_key: priv key bits set: 128/256
debug1: bits set: 1592/3191
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'billc' is known and matches the RSA host key.
debug1: Found key in /home/t/.ssh/known_hosts:2
debug1: bits set: 1566/3191
debug1: ssh_rsa_verify: signature correct
debug1: newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: done: ssh_kex2.
debug1: send SSH2_MSG_SERVICE_REQUEST
debug1: got SSH2_MSG_SERVICE_ACCEPT
debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive
debug1: Next authentication method: gssapi-keyex
debug1: Next authentication method: gssapi-with-mic
debug1: Failed to acquire GSS-API credentials for any mechanisms (No credentials were supplied, or the credentials were unavailable or inaccessible
Unknown code 0
)
debug1: Next authentication method: publickey
debug1: Trying private key: /home/t/.ssh/identity
debug1: Trying public key: /home/t/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 149 lastkey 6dd88 hint 1
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey)
debug1: channel 0: new [client-session]
09-19-2008, 05:20 AM
#7
Member
Registered: May 2007
Posts: 100
Original Poster
Rep:
some more findings from my application :
when I
telnet hostname portnumber
Trying...
Connected to hostname.x.lan.
Escape character is '^]'.
prompt>
with the ssh
ssh hostname -p 39505 -v
OpenSSH_3.8, OpenSSL 0.9.7d 17 Mar 2004
HP-UX_Secure_Shell-A.03.81.003, HP_UX Secure Shell version
debug1: Reading configuration data /opt/ssh/etc/ssh_config
debug1: Connecting to hostname [10.0.8.10] port 39505.
debug1: Connection established.
debug1: identity file /home/t/.ssh/id_rsa type 1
debug1: identity file /home/t/.ssh/id_dsa type 2
It appears the ssh session tahts established isn't sending or receiving requests as it hangs not responding .
Whereas I would expect the same behaviour from the telnet session returning back to prompt> as requested in the code .
Any ideas why I'm not getting this with ssh ????????????????
Last edited by nano2; 09-22-2008 at 03:45 PM .
All times are GMT -5. The time now is 04:30 PM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News