diff --git a/request-server.go b/request-server.go
index <HASH>..<HASH> 100644
--- a/request-server.go
+++ b/request-server.go
@@ -174,6 +174,15 @@ func (rs *RequestServer) packetWorker(
 				request = NewRequest("Stat", request.Filepath)
 				rpkt = request.call(rs.Handlers, pkt)
 			}
+		case *sshFxpExtendedPacket:
+			switch expkt := pkt.SpecificPacket.(type) {
+			default:
+				rpkt = statusFromError(pkt, ErrSshFxOpUnsupported)
+			case *sshFxpExtendedPacketPosixRename:
+				request := NewRequest("Rename", expkt.Oldpath)
+				request.Target = expkt.Newpath
+				rpkt = request.call(rs.Handlers, pkt)
+			}
 		case hasHandle:
 			handle := pkt.getHandle()
 			request, ok := rs.getRequest(handle)
@@ -187,7 +196,7 @@ func (rs *RequestServer) packetWorker(
 			rpkt = request.call(rs.Handlers, pkt)
 			request.close()
 		default:
-			return errors.Errorf("unexpected packet type %T", pkt)
+			rpkt = statusFromError(pkt, ErrSshFxOpUnsupported)
 		}
 
 		rs.pktMgr.readyPacket(
sftp: support rename extension for server

Previously if a client makes an unsupported operation,
like a POSIX rename, it would exit the server.

Both support POSIX rename, and do not abort the connection
if there is an unsupported operation is made by the client.