LinuxQuestions.org
Help answer threads with 0 replies.
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 10-10-2012, 08:55 AM   #31
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985

What have you been doing up until now??

netstat -plnt

and check there is no reference to :22. then start the service again.
 
Old 10-10-2012, 08:58 AM   #32
gajananh999
Member
 
Registered: Aug 2012
Posts: 94

Original Poster
Rep: Reputation: Disabled
Sorry I Am new to linux platform so please excuse me...

root@ip-10-84-238-191:[/var/log]
$ netstat -plnt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:928 0.0.0.0:* LISTEN 1170/rpc.statd
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1135/portmap
tcp 0 0 0.0.0.0:12981 0.0.0.0:* LISTEN 1800/pageidserver
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1511/cupsd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1562/sendmail: acce
tcp 0 0 :::8080 :::* LISTEN 2159/tnslsnr
tcp 0 0 :::1521 :::* LISTEN 2159/tnslsnr
tcp 0 0 :::37521 :::* LISTEN 2014/ora_d000_SA
tcp 0 0 :::22 :::* LISTEN 23717/sshd
root@ip-10-84-238-191:[/var/log]
$ tail -5 secure
Oct 10 19:20:48 ip-10-84-238-191 sshd[22985]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
Oct 10 19:21:56 ip-10-84-238-191 sshd[22985]: Received signal 15; terminating.
Oct 10 19:22:13 ip-10-84-238-191 sshd[23717]: Server listening on :: port 22.
Oct 10 19:22:13 ip-10-84-238-191 sshd[23717]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
Oct 10 19:24:34 ip-10-84-238-191 sudo: root : TTY=pts/1 ; PWD=/var/log ; USER=root ; COMMAND=/sbin/service ssh stop
root@ip-10-84-238-191:[/var/log]
$ /etc/init.d/sshd start
Starting sshd: [ OK ]
root@ip-10-84-238-191:[/var/log]
$ tail -5 secure
Oct 10 19:22:13 ip-10-84-238-191 sshd[23717]: Server listening on :: port 22.
Oct 10 19:22:13 ip-10-84-238-191 sshd[23717]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
Oct 10 19:24:34 ip-10-84-238-191 sudo: root : TTY=pts/1 ; PWD=/var/log ; USER=root ; COMMAND=/sbin/service ssh stop
Oct 10 19:27:01 ip-10-84-238-191 sshd[26174]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
Oct 10 19:27:01 ip-10-84-238-191 sshd[26174]: fatal: Cannot bind any address.
 
Old 10-10-2012, 09:43 AM   #33
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
right so there PID 23717 is listening, which was started shortly before. So is it still not working?

If in doubt, reboot the box, then clearly nothing can persist.
 
Old 10-10-2012, 11:23 AM   #34
gajananh999
Member
 
Registered: Aug 2012
Posts: 94

Original Poster
Rep: Reputation: Disabled
NO its giving the same error.

See basically What i m doing here i want to transfer some data to linux server so. So i have written one .bat file which zip the content and then it will send to linux server using a SFTP.

i will paste here sample output of batch file.

Code:
Daily Test01 Backup 
Starting backup.  Creating ZIP file... 
ZIP file created OK.  Now uploading file... 
psftp -batch -v -pw notused -b "Daily Test01 Backup_tempcommands.sftp" -bc -be -l root -P 22 -i "E:\00ISAC\03Projects\Client\Carwale\Code\zipcode\carwaleec2.ppk" 23.23.84.118 
Looking up host "23.23.84.118"
Connecting to 23.23.84.118 port 22
Server version: SSH-2.0-OpenSSH_4.3
Using SSH protocol version 2
We claim version: SSH-2.0-PuTTY_Release_0.62
Doing Diffie-Hellman group exchange
Doing Diffie-Hellman key exchange with hash SHA-1
Host key fingerprint is:
ssh-rsa 2048 be:8b:4e:ff:8c:27:e0:ca:8a:7c:73:05:a4:f8:51:28
Initialised AES-256 SDCTR client->server encryption
Initialised HMAC-SHA1 client->server MAC algorithm
Initialised AES-256 SDCTR server->client encryption
Initialised HMAC-SHA1 server->client MAC algorithm
Reading private key file "E:\00ISAC\03Projects\Client\Carwale\Code\zipcode\carwaleec2.ppk"
Using username "root".
Offered public key
Offer of public key accepted
Authenticating with public key "imported-openssh-key"
Sent public key signature
Access granted
Opened channel for session
Primary command failed; attempting fallback
Started a shell/command
Server sent command exit status 127
bash: line 2: exec: sftp-server: not found
Disconnected: All channels closed
Connected to 23.23.84.118
Fatal: unable to initialise SFTP: could not connect
File upload FAILED!!! 
File upload process complete. Deleting temporary files...
Completed backup process.
So i m not understanding where i m going wrong
 
Old 10-10-2012, 01:48 PM   #35
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
stop the process and run it directly.

/usr/sbin/sshd -dd

and then with that running, try to connect and look at the debug output that is shown.
 
Old 10-10-2012, 11:35 PM   #36
gajananh999
Member
 
Registered: Aug 2012
Posts: 94

Original Poster
Rep: Reputation: Disabled
i done this but same output

Code:
root@ip-10-84-238-191:[/root]
$ /usr/sbin/sshd -dd
debug2: load_server_config: filename /etc/ssh/sshd_config
debug2: load_server_config: done config len = 518
debug2: parse_server_config: config /etc/ssh/sshd_config len 518
debug1: sshd version OpenSSH_4.3p2
debug1: read PEM private key done: type RSA
debug1: private host key: #0 type 1 RSA
debug1: read PEM private key done: type DSA
debug1: private host key: #1 type 2 DSA
debug1: rexec_argv[0]='/usr/sbin/sshd'
debug1: rexec_argv[1]='-dd'
debug2: fd 3 setting O_NONBLOCK
debug1: Bind to port 22 on ::.
debug2: fd 3 setting O_NONBLOCK
debug1: Bind to port 22 on 0.0.0.0.
Bind to port 22 on 0.0.0.0 failed: Address already in use.
Cannot bind any address.
And the output of .batch file is same as earlier.
 
Old 10-11-2012, 12:57 AM   #37
gajananh999
Member
 
Registered: Aug 2012
Posts: 94

Original Poster
Rep: Reputation: Disabled
Yes i got answer for this. i was adding Subsystem sftp /usr/libexec/openssh/sftp-server this to ssh_config but when i added this to sshd_config file and i restarted sshd then it started working for me.
 
  


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
How to establish direct connection between Linux machine and Windows 7 machine capodicapi Linux - Newbie 7 10-12-2012 08:44 AM
[SOLVED] Windows7/Ubuntu 12.04 Dual Boot - Wireless Connection Does Not Work in Linux Riley381 Linux - Wireless Networking 2 09-13-2012 01:58 PM
Access windows7 client machine in internet kaviajan Linux - Server 2 08-01-2012 02:45 AM
Sftp connection between Windows server and linux server vikash.thbs Linux - Server 2 01-02-2012 10:25 AM
lan connection between linux machine and windows machine arunsan842004 Linux - Laptop and Netbook 1 11-25-2008 05:44 AM

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

All times are GMT -5. The time now is 02:48 PM.

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