LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-14-2014, 01:37 PM   #1
vikky
LQ Newbie
 
Registered: Apr 2012
Posts: 26
Blog Entries: 1

Rep: Reputation: Disabled
Thumbs up Write failed: Broken pipe


getting kicked out from the console.Getting below error:

Write failed: Broken pipe

[root@home ~]# cat /etc/ssh/sshd_config |grep ClientAlive*
#ClientAliveInterval 0
#ClientAliveCountMax 3
ClientAliveInterval 60
ClientAliveInterval 60

[root@home ~]# tail -f /var/log/messages
Mar 12 17:18:30 home rpc.statd[18915]: Version 1.2.3 starting
Mar 12 17:18:30 home rpc.statd[18915]: Flags: TI-RPC

Any immediate help would be appreciated....!!!
 
Old 03-14-2014, 02:30 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,454

Rep: Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353
Yeah, a broken pipe is what you would get. This line
Quote:
cat /etc/ssh/sshd_config |grep ClientAlive*
has cat piped to grep. But cat only lasts as long as your file, and then abruptly exits, leaving the pipe to grep broken.

You don't actually need the 'cat' at all. grep will read the file.

Code:
grep ClientAlive*   /etc/ssh/sshd_config
If you're scripting, there's some switch for grep that sets whether it found it or not (exits 0 or 1).
 
Old 03-14-2014, 02:58 PM   #3
vikky
LQ Newbie
 
Registered: Apr 2012
Posts: 26

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
issue is here that SSH connection dies after few minutes.Leaving the below error:

-bash-4.1$ Write failed: Broken pipe
 
Old 03-15-2014, 05:07 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,454

Rep: Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353
The cat would exit nearly instantly.
 
1 members found this post helpful.
Old 03-15-2014, 08:17 PM   #5
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
Older default fedora sshd configurations would time out after some minutes and disconnect the client, leaving the same error message. It seems to me I had to change a setting in the putty connection settings to send a client keep alive packet (if you're using putty). There is an options setting in linux ssh to provide TCPkeepalive maybe it can help.

Anyway, current fedora settings don't seem to have this problem any longer, maybe you can compare your sshd_config with a new default sshd_config and see if there are any big differences. Nowdays I just open a default settings ssh connection and it stays open for days.
 
Old 03-20-2014, 06:16 PM   #6
vikky
LQ Newbie
 
Registered: Apr 2012
Posts: 26

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
copied ssh files from other server but no luck even tried removing ssh and installed again.
using 6.4 RHEL 64 bit
ssh -vvv o/p
Last login: Thu Mar 20 18:53:31 2014 from
[root@host ~]# debug1: client_input_channel_req: channel 0 rtype keepalive@openssh.com reply 1
debug1: client_input_channel_req: channel 0 rtype keepalive@openssh.com reply 1
Write failed: Broken pipe

[root@local1 ~]# tail /var/log/messages
Mar 20 16:57:29 local kernel: sd 1:0:1:1: [sdba] Attached SCSI disk

It can be a hardware issue?

Last edited by vikky; 03-20-2014 at 06:40 PM. Reason: adding aditional info
 
Old 03-20-2014, 07:03 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
Nope. At least not at first glance.

ClientAliveInterval 60 will send a message every 60 sec if no activity is detected for a max of 3 times (default max count) i.e. 180 seconds. So after 3 minutes of no activity your connection should be automatically broken.

You can set the value higher say 600 (15 minutes) as well as configure the client to send a similar message i.e. SeverAliveInterval 600.

Last edited by michaelk; 03-20-2014 at 07:08 PM.
 
Old 03-21-2014, 06:35 AM   #8
vikky
LQ Newbie
 
Registered: Apr 2012
Posts: 26

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Michael,
Actually i have commented those entries.
What im looking for
My console should be alive even though if im not firing any commands aleast for one hour or more...!!!
 
Old 03-24-2014, 02:02 PM   #9
vikky
LQ Newbie
 
Registered: Apr 2012
Posts: 26

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Able to resolved it after uninstalled all the ssh* packages and installed it again and rebooted the server as getting I/O error.
 
  


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
[SOLVED] cat: write error: Broken pipe MikeyCarter Linux - Software 4 06-19-2013 02:26 PM
SSH-Write failed broken pipe Error vignesh4sh Linux - Server 1 11-22-2012 11:01 AM
[ssh] write failed: broken pipe mosthated Linux - Newbie 2 06-28-2012 06:21 AM
ssh Write failed: Broken pipe shogun1234 Linux - Networking 3 12-08-2010 09:33 PM
Doom 3 demo: snd_pcm_writei failed: Broken pipe nikolaj Linux - Games 0 04-14-2005 12:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:07 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