• 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 , write failed: broken pipe , packet_write_wait: connection to broken pipe , packet_write_wait , packet write wait broken pipe , port 22 broken pipe , connection to 10 170 4 14 port 22: broken linux
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, 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)

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • WordPress & PHP : Different AdSense Units on Mobile Devices

    Here is How To Serve Different AdSense Units on Mobile Devices on WordPress With PHP. WordPress Has Function Which Can Be Used In Free Way.

  • Bypass Blocked SSH Port and Wrong iptables Rules

    New Users Read the Bad Blogs & Later Fail to SSH. Here is How to Bypass Blocked SSH Port and Wrong iptables Rules. Commands to Check SSH Log Included.

  • Changing Data With cURL for OpenStack Swift (HP Cloud CDN)

    Changing Data With cURL For Object is Quite Easy in OpenStack Swift. Here Are Examples With HP Cloud CDN To Make it Clear. Official Examples Are Bad.

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

Get new posts by email:

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 (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

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

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