Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
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.
|
 |
|
10-10-2012, 08:55 AM
|
#31
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
What have you been doing up until now??
netstat -plnt
and check there is no reference to :22. then start the service again.
|
|
|
10-10-2012, 08:58 AM
|
#32
|
Member
Registered: Aug 2012
Posts: 94
Original Poster
Rep: 
|
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.
|
|
|
10-10-2012, 09:43 AM
|
#33
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
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.
|
|
|
10-10-2012, 11:23 AM
|
#34
|
Member
Registered: Aug 2012
Posts: 94
Original Poster
Rep: 
|
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
|
|
|
10-10-2012, 01:48 PM
|
#35
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
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.
|
|
|
10-10-2012, 11:35 PM
|
#36
|
Member
Registered: Aug 2012
Posts: 94
Original Poster
Rep: 
|
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.
|
|
|
10-11-2012, 12:57 AM
|
#37
|
Member
Registered: Aug 2012
Posts: 94
Original Poster
Rep: 
|
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.
|
|
|
All times are GMT -5. The time now is 12:04 AM.
|
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
|
|