• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » Fix Write Failed Broken Pipe (packet_write_wait: Connection to port 22: Broken pipe)

By Abhishek Ghosh June 26, 2017 7:23 am Updated on June 26, 2017

Fix Write Failed Broken Pipe (packet_write_wait: Connection to port 22: Broken pipe)

Advertisement

There are hundreds of questions and answers on various websites on Broken Pipe issue. The problem is essentially closed connection when a SSH session is not kept active by typing or running command. None of those websites can explain or give a universal easy fix. Readers report us of packet_write_wait: Connection to port 22: Broken pipe. Here is how to fix write failed broken pipe on mac, gnu/linux. It is actually easy matter.

 

Fix Write Failed Broken Pipe (packet_write_wait: Connection to port 22: Broken pipe)

 

The error is common after new installation of a unix or unix like operating systems or upgrade of such operating systems. Easiest way to keep the session active for a predefined period is to SSH on the server with command of this format :

Vim
1
ssh -o ServerAliveInterval=60 username@IP_ADDRESS

ServerAliveInterval= is variable in minutes. 60 is one hour. username is something which you use to SSH like root by default. IP_ADDRESS is the IP address of your server.

Advertisement

---

Fix Write Failed Broken Pipe packet_write_wait- Connection to port 22- Broken pipe

 

Why Various Q&A Site Fails To Fix Write Failed Broken Pipe & Why It Happens?

 

It happens out of wrong permission, ownership of the files, directories related to SSH after an upgrade. It is essentially a security feature of unix or unix like operating systems. Run a ls -al on your Mac of Linux desktop/laptop (client) :

Vim
1
ls -al /etc/ssh/sshd_config

You will notice that result will be like this :

Vim
1
-rw-r--r--  1 root  wheel  3351 Jun 24 02:14 /etc/ssh/sshd_config

Owner belongs to unix wheel group. For MacOS X, for each version there are different ways to get root access on your Mac which is available on Apple’s website. Even if you enabled for older version of MacOS X, you need to follow this guide for the newer MacOS X like Sierra in our example :

Vim
1
https://support.apple.com/en-us/HT204012

You can also of it from command line by running :

Vim
1
dsenableroot

Apple has some security fixes, which makes becoming root difficult. You can read this documentation of sudo :

Vim
1
https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man8/sudo.8.html

Open Terminal, not iTerm2 and Oh My ZSH and run :

Vim
1
sudo -s

As root you can modify ownership, permission of the files owned by root, wheel group. As root user, run this command to find the configuration file :

Vim
1
find / -name sshd_config

Which sshd_config is used is complicated matter for ZSH/Oh-My-ZSH like shells – it can be /etc/ssh_config, /etc/ssh/ssh_config, even inside the private directory. Basically on the sshd_config you need to add/modify :

Vim
1
2
3
ClientAliveCountMax 4
ClientAliveInterval 30
TCPKeepAlive yes

At worse, there are more files to config. The .bashrc or .zshrc should have :

Vim
1
2
3
TMOUT=300
readonly TMOUT
export TMOUT

There is ~/.ssh/config, which should have :

Vim
1
2
3
Host *
    ServerAliveInterval 300
    TCPKeepAlive no

Shut down the Mac and switch on. If still problem persists, you need to change the ownership of the files to the user’s name. Running :

Vim
1
ssh -o ServerAliveInterval=60 username@IP_ADDRESS

is safe and secured way for your servers and Mac.

Tagged With packet_write_wait: Connection to port 22: Broken pipe , packet_write_wait broken pipe , port 22: broken pipe , packet_write_wait: Connection to UNKNOWN port 65535: Broken pipe , packet_write_wait: connection to broken pipe , packet_write_wait , packet write wait broken pipe , port 22 broken pipe , write failed: broken pipe , connection to 10 170 4 14 port 22: broken linux

This Article Has Been Shared 241 Times!

Facebook Twitter Pinterest
Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Orthopaedic Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Fix Write Failed Broken Pipe (packet_write_wait: Connection to port 22: Broken pipe)

  • Mac OS X Original Theme for Ubuntu 12.04 : Will You Like It ?

    Mac OS X Original Theme for Ubuntu 12.04 will make Ubuntu look like Apple Mac OS X simply as the components are ported from Mac. But is it great to steal ?

  • Sound Forge Pro Mac : Review and Guide For Audiophiles

    Sound Forge Pro Mac is basically an advanced sound software like its brother for Windows. Audio processing quality is superb and it its fine to listen to music.

  • Text Editors for Mac OS X : Best of the Bests yet Free

    Text Editors for Mac OS X are required for more advanced functions than the default text editors like helpful syntax highlighting, macro and tabs.

  • grep command : Details, Examples and Usages of Grep Command

    grep command for a program of UNIX and Unix like Operating System. It is used to search and filter. Historically, the name evolved from the command g / re / p.

  • UNIX Commands Video Guide to Get Started

    UNIX Commands Video Guide is for the starters to push towards the black screen to understand how basically we need to work with command line tool or CLI.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

You can subscribe to our Free Once a Day, Regular Newsletter by clicking the subscribe button below.

Click To Subscribe

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (20K Followers)
  • Twitter (4.9k Followers)
  • Facebook (5.8k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.2k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • What is Inertial Navigation System? January 25, 2021
  • What is Miniaturization? January 24, 2021
  • What is Domain-Driven Design (DDD)? January 23, 2021
  • Top 10 Anti Hacking Software for Microsoft Windows January 22, 2021
  • What is Software Modernization? January 21, 2021

 

About This Article

Cite this article as: Abhishek Ghosh, "Fix Write Failed Broken Pipe (packet_write_wait: Connection to port 22: Broken pipe)," in The Customize Windows, June 26, 2017, January 25, 2021, https://thecustomizewindows.com/2017/06/fix-write-failed-broken-pipe-packet_write_wait-connection-port-22-broken-pipe/.

Source:The Customize Windows, JiMA.in

 

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Cookie Policy.

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2021 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy