Open ssh error: packet_write_wait: Connection to x.x.x.x port 22: Broken pipe
First i am going to explain what I'm trying to do. I have set up a webserver running ubuntu server on top of vmware-esxi. I want to use SFTP over SSH to upload my website's code. We did this in a php class I took.
I followed this guide.
So I have a user named sftpuser and a group called sftp and when I try to connect it gives the error:
packet_write_wait: Connection to x.x.x.x port 22: Broken pipe
My ssh config looks this at the bottom, the rest is unchanged
ClientAliveInterval 20
ClientAliveCountMax 5
TCPKeepAlive yes
Match group sftp
ChrootDirectory %h
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
I'm new to linux so I'm unsure what the cause could be. Thanks.
Edit:
The error in /var/log/auth.log is
fatal: bad ownership of chroot directory component "/var/www"
networking server 18.04 ssh sftp
add a comment |
First i am going to explain what I'm trying to do. I have set up a webserver running ubuntu server on top of vmware-esxi. I want to use SFTP over SSH to upload my website's code. We did this in a php class I took.
I followed this guide.
So I have a user named sftpuser and a group called sftp and when I try to connect it gives the error:
packet_write_wait: Connection to x.x.x.x port 22: Broken pipe
My ssh config looks this at the bottom, the rest is unchanged
ClientAliveInterval 20
ClientAliveCountMax 5
TCPKeepAlive yes
Match group sftp
ChrootDirectory %h
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
I'm new to linux so I'm unsure what the cause could be. Thanks.
Edit:
The error in /var/log/auth.log is
fatal: bad ownership of chroot directory component "/var/www"
networking server 18.04 ssh sftp
1
Can you give the content of /var/log/auth.log from the server?
– olivierb2
Jan 15 at 9:17
add a comment |
First i am going to explain what I'm trying to do. I have set up a webserver running ubuntu server on top of vmware-esxi. I want to use SFTP over SSH to upload my website's code. We did this in a php class I took.
I followed this guide.
So I have a user named sftpuser and a group called sftp and when I try to connect it gives the error:
packet_write_wait: Connection to x.x.x.x port 22: Broken pipe
My ssh config looks this at the bottom, the rest is unchanged
ClientAliveInterval 20
ClientAliveCountMax 5
TCPKeepAlive yes
Match group sftp
ChrootDirectory %h
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
I'm new to linux so I'm unsure what the cause could be. Thanks.
Edit:
The error in /var/log/auth.log is
fatal: bad ownership of chroot directory component "/var/www"
networking server 18.04 ssh sftp
First i am going to explain what I'm trying to do. I have set up a webserver running ubuntu server on top of vmware-esxi. I want to use SFTP over SSH to upload my website's code. We did this in a php class I took.
I followed this guide.
So I have a user named sftpuser and a group called sftp and when I try to connect it gives the error:
packet_write_wait: Connection to x.x.x.x port 22: Broken pipe
My ssh config looks this at the bottom, the rest is unchanged
ClientAliveInterval 20
ClientAliveCountMax 5
TCPKeepAlive yes
Match group sftp
ChrootDirectory %h
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
I'm new to linux so I'm unsure what the cause could be. Thanks.
Edit:
The error in /var/log/auth.log is
fatal: bad ownership of chroot directory component "/var/www"
networking server 18.04 ssh sftp
networking server 18.04 ssh sftp
edited Jan 15 at 18:21
Hayden Mumm
asked Jan 15 at 7:40
Hayden MummHayden Mumm
63
63
1
Can you give the content of /var/log/auth.log from the server?
– olivierb2
Jan 15 at 9:17
add a comment |
1
Can you give the content of /var/log/auth.log from the server?
– olivierb2
Jan 15 at 9:17
1
1
Can you give the content of /var/log/auth.log from the server?
– olivierb2
Jan 15 at 9:17
Can you give the content of /var/log/auth.log from the server?
– olivierb2
Jan 15 at 9:17
add a comment |
1 Answer
1
active
oldest
votes
Ok the issue seems to be I did not have permissions for /var/www, when I changed the permissions as shown in the guide I did that for /var/www/html. So when I ran this
cd /var/www
chown root:sftp .
chmod 755 .
chown -R sftpuser:sftp *
it worked. I also ran it again on /var/www/html just to be sure.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1109840%2fopen-ssh-error-packet-write-wait-connection-to-x-x-x-x-port-22-broken-pipe%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Ok the issue seems to be I did not have permissions for /var/www, when I changed the permissions as shown in the guide I did that for /var/www/html. So when I ran this
cd /var/www
chown root:sftp .
chmod 755 .
chown -R sftpuser:sftp *
it worked. I also ran it again on /var/www/html just to be sure.
add a comment |
Ok the issue seems to be I did not have permissions for /var/www, when I changed the permissions as shown in the guide I did that for /var/www/html. So when I ran this
cd /var/www
chown root:sftp .
chmod 755 .
chown -R sftpuser:sftp *
it worked. I also ran it again on /var/www/html just to be sure.
add a comment |
Ok the issue seems to be I did not have permissions for /var/www, when I changed the permissions as shown in the guide I did that for /var/www/html. So when I ran this
cd /var/www
chown root:sftp .
chmod 755 .
chown -R sftpuser:sftp *
it worked. I also ran it again on /var/www/html just to be sure.
Ok the issue seems to be I did not have permissions for /var/www, when I changed the permissions as shown in the guide I did that for /var/www/html. So when I ran this
cd /var/www
chown root:sftp .
chmod 755 .
chown -R sftpuser:sftp *
it worked. I also ran it again on /var/www/html just to be sure.
answered Jan 16 at 18:31
Hayden MummHayden Mumm
63
63
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1109840%2fopen-ssh-error-packet-write-wait-connection-to-x-x-x-x-port-22-broken-pipe%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Can you give the content of /var/log/auth.log from the server?
– olivierb2
Jan 15 at 9:17