Bảo mậtSecurity

Máy của bạn, dữ liệu của bạnYour machines, your data

SwiftDesk được thiết kế để chạy trong mạng LAN tin cậy hoặc tailnet Tailscale. Trang này nói rõ SwiftDesk tự bảo vệ những gì, dựa vào mạng ở đâu, và những việc bạn nên làm.SwiftDesk is designed to run inside a trusted LAN or a Tailscale tailnet. This page explains what SwiftDesk protects itself, where it relies on the network, and what you should do.

1. Lớp mạng

Host chỉ nhận kết nối từ LAN riêng và Tailscale (mặc định), hoặc chỉ Tailscale. Kết nối ngoài phạm vi bị từ chối trước cả bước PIN. Tailscale bọc mọi gói trong WireGuard.

2. Lớp pairing

PIN dùng một lần hoặc cố định, token riêng cho từng thiết bị (host chỉ lưu SHA-256), chống dò PIN, owner, duyệt kết nối, thu hồi, nhật ký.

3. Lớp phiên

Video, âm thanh, chuột phím, clipboard và file đi trong WebRTC DTLS-SRTP, mã hóa đầu cuối giữa client và host, kể cả khi bắt tay đi qua relay.

Pairing và quyền

Cơ chếChi tiết
PIN6 số ngẫu nhiên lần đầu. Rotate: dùng một lần rồi tự đổi. Fixed: giữ tới khi đổi. Pair lại bằng PIN với một thiết bị đã có luôn hạ về vai trò user.
Token thiết bị32 byte ngẫu nhiên, cấp khi PIN đúng. Host chỉ lưu SHA-256 của token, không lưu token thật.
Chống dò PIN5 lần sai từ một IP: khóa 60 giây. 30 lần sai trong 10 phút từ mọi IP: khóa pairing và đổi PIN nếu đang Rotate.
OwnerThiết bị pair đầu tiên. Chỉ owner xem và đổi PIN, đổi vai trò, thu hồi thiết bị, đọc nhật ký, tự nhận clipboard của host và mở AI Terminal.
Duyệt kết nốiBật “Ask me before anyone connects”: thiết bị không phải owner phải được bấm Accept trên máy host trong 30 giây.
Thu hồiTừ khay, trang quản trị, app của owner hoặc cloud. Phiên đang mở của thiết bị đó bị ngắt ngay.
Giới hạnTối đa 6 phiên cùng lúc; kết nối không chào trong 10 giây bị đóng.
Trang quản trị/admin chỉ phục vụ chính máy host (loopback).

Dữ liệu trong phiên

  • Clipboard: host chỉ gửi clipboard cho phiên của owner. Thiết bị thường dán sang host được nhưng không đọc được clipboard của host.
  • File gửi lên host: lưu vào Downloads/SwiftDesk/, tên file được làm sạch, gắn nhãn tải từ internet (Mark of the Web trên Windows, quarantine trên macOS), tối đa 16 GB mỗi phiên, có ghi nhật ký.
  • Khóa màn hình từ xa: chỉ khóa được, không mở khóa được qua SwiftDesk. Đây là chủ ý.
  • Trình duyệt: chỉ được mở kết nối tới host khi Origin trùng với Host, chặn tấn công từ trang web khác.
  • SSH: dấu vân tay khóa máy chủ được ghim lần đầu; nếu khóa đổi, app cảnh báo rõ và hỏi trước khi chấp nhận.

AI Terminal

  • AI Terminal mở shell trên máy host với quyền của người dùng đang đăng nhập, tức là toàn quyền như ngồi trước máy. Vì vậy chỉ thiết bị owner mở được.
  • Muốn cấp quyền này cho một thiết bị, người ở máy host phải bấm Make owner trong cửa sổ SwiftDesk → Paired devices. Thu hồi thiết bị là thiết bị đó mất quyền ngay.
  • Phiên chạy tiếp sau khi bạn đóng trình duyệt hoặc app. Trên macOS và Linux, phiên nằm trong tmux (socket swiftdesk) và còn sau khi host khởi động lại; hãy đóng phiên không dùng nữa.
  • AI Terminal chưa đi qua relay của cloud; chỉ dùng trực tiếp trong LAN hoặc Tailscale.

Mật khẩu đã lưu và file export

  • Remember password lưu mật khẩu SSH và VNC trong keychain của hệ điều hành, không lưu trong file danh bạ.
  • Export Hosts only không chứa mật khẩu hay token.
  • Export Hosts + saved passwords (encrypted) mã hóa bằng AES-256-GCM với passphrase bạn đặt. Dùng passphrase dài, không gửi passphrase chung đường với file.

SwiftDesk Cloud (tùy chọn)

  • Đăng nhập bằng passkey, tài khoản mới chỉ qua lời mời.
  • Cloud ký token kết nối Ed25519 sống 5 phút, gắn với đúng host và đúng thiết bị; token cloud không tạo pairing lâu dài.
  • Relay chỉ chuyển bước bắt tay (SDP, ICE). Hình và tiếng vẫn mã hóa đầu cuối.
  • Token của app lưu trong Keychain/Keystore, hết hạn sau 180 ngày. Dashboard có nút Sign out everywhere.

Những gì bạn cần biết

Rủi roGiải thíchNên làm
Bắt tay chưa có TLSKênh WebSocket trên cổng 7340 là ws://. Trong tailnet đã được WireGuard bọc; hình và tiếng luôn mã hóa.Không mở cổng 7340 ra internet. Ở mạng công cộng, chỉ kết nối qua Tailscale.
/api/info không cần đăng nhậpLộ tên máy và kích thước màn hình, chỉ trong phạm vi mạng cho phép.Đặt tên host trung tính.
Token nằm trên thiết bịAi mở khóa được thiết bị đã pair là vào được host.Khóa thiết bị. Mất máy thì thu hồi ngay.
Quyền hệ điều hànhHost chạy với quyền của người dùng đang đăng nhập.Không chạy host dưới tài khoản admin nếu không cần.

Danh sách việc nên làm

  1. Bật Ask me before anyone connects trên máy có dữ liệu nhạy cảm, hoặc khi cho người khác mượn PIN.
  2. Dùng PIN Rotate trừ khi bạn thật sự cần PIN cố định.
  3. Chỉ cấp owner cho thiết bị của chính bạn: owner mở được terminal trên host.
  4. Ra ngoài mạng nhà: chạy host với --network tailnet và chỉ kết nối qua Tailscale.
  5. Vài tháng một lần, xem danh sách thiết bị đã pair và thu hồi thiết bị không còn dùng.
  6. Mất điện thoại: thu hồi thiết bị trên từng host; nếu dùng cloud, bấm Sign out everywhere.
  7. Không bao giờ duyệt mã thiết bị mà người khác gửi cho bạn.
  8. Mở file nhận qua SwiftDesk như file tải từ internet; đừng bỏ qua cảnh báo SmartScreen hay Gatekeeper với file lạ.
  9. Cập nhật host khi có bản mới.

1. Network layer

The host only accepts peers from private LAN ranges and Tailscale (default), or Tailscale only. Anyone outside the scope is refused before the PIN check. Tailscale wraps every packet in WireGuard.

2. Pairing layer

One-time or fixed PIN, per-device tokens (the host stores only SHA-256), brute-force protection, owner role, connection approval, revocation, audit log.

3. Session layer

Video, audio, input, clipboard and files travel in WebRTC DTLS-SRTP, end-to-end encrypted between client and host, even when the handshake is relayed.

Pairing and permissions

MechanismDetails
PINSix random digits at first start. Rotate: single use, then replaced. Fixed: kept until changed. Re-pairing a known device with the PIN always drops it to the user role.
Device token32 random bytes issued after a correct PIN. The host stores only its SHA-256, never the token itself.
PIN guessing5 failures from one IP: 60-second lockout. 30 failures from any IP within 10 minutes: pairing locked and the PIN rotated in Rotate mode.
OwnerThe first paired device. Only the owner views and changes the PIN, changes roles, revokes devices, reads the log, automatically receives the host clipboard and opens AI Terminal.
ApprovalWith “Ask me before anyone connects”, non-owner devices wait for Accept on the host, 30-second timeout.
RevocationFrom the tray, admin page, owner app or cloud. That device's live sessions end immediately.
LimitsAt most 6 concurrent sessions; connections that do not say hello within 10 seconds are closed.
Admin page/admin is served to the host machine only (loopback).

Data in a session

  • Clipboard: the host sends its clipboard to owner sessions only. Other devices can paste into the host but cannot read its clipboard.
  • Files sent to the host: saved to Downloads/SwiftDesk/ with sanitized names, marked as downloaded from the internet (Mark of the Web on Windows, quarantine on macOS), capped at 16 GB per session, and logged.
  • Remote lock: SwiftDesk can lock the host but never unlock it. This is intentional.
  • Browsers: may only open the signaling connection when the Origin matches the Host, which blocks attacks from other websites.
  • SSH: the server key fingerprint is pinned on first use; if the key changes, the app warns clearly and asks before accepting it.

AI Terminal

  • AI Terminal opens a shell on the host with the signed-in user's rights, which is the same as sitting at the machine. That is why only owner devices can open it.
  • To give a device this right, the person at the host presses Make owner in the SwiftDesk window → Paired devices. Revoking a device removes the right immediately.
  • Sessions keep running after you close the browser or app. On macOS and Linux they live in tmux (socket swiftdesk) and survive host restarts; close sessions you no longer need.
  • AI Terminal does not go through the cloud relay yet; use it directly over LAN or Tailscale.

Saved passwords and export files

  • Remember password keeps SSH and VNC passwords in the system keychain, not in the address book file.
  • A Hosts only export contains no passwords or tokens.
  • A Hosts + saved passwords (encrypted) export is encrypted with AES-256-GCM using your passphrase. Use a long passphrase and never send it along with the file.

SwiftDesk Cloud (optional)

  • Passkey sign-in; new accounts by invitation only.
  • The cloud signs 5-minute Ed25519 connect tokens bound to one host and one device; a cloud token never creates a permanent pairing.
  • The relay only forwards the handshake (SDP, ICE). Video and audio stay end-to-end encrypted.
  • App tokens live in Keychain/Keystore and expire after 180 days. The dashboard has Sign out everywhere.

What you should know

RiskExplanationWhat to do
Signaling has no TLS yetThe WebSocket on port 7340 is plain ws://. Inside a tailnet WireGuard protects it; media is always encrypted.Never expose port 7340 to the internet. On public networks, connect only through Tailscale.
/api/info is unauthenticatedReveals the host name and screen size, only within the allowed network scope.Use a neutral host name.
Tokens live on your devicesAnyone who can unlock a paired device can reach the host.Lock your devices. Revoke a lost one right away.
OS permissionsThe host runs with the signed-in user's rights.Do not run the host under an admin account unless needed.

Checklist

  1. Turn on Ask me before anyone connects on machines with sensitive data, or when lending the PIN.
  2. Keep the Rotate PIN mode unless you really need a fixed PIN.
  3. Make only your own devices owners: an owner can open a terminal on the host.
  4. Away from home: run the host with --network tailnet and connect only over Tailscale.
  5. Every few months, review paired devices and revoke the ones you no longer use.
  6. Lost a phone: revoke it on every host; with the cloud, press Sign out everywhere.
  7. Never approve a device code that someone else sent you.
  8. Treat files received through SwiftDesk like internet downloads; do not skip SmartScreen or Gatekeeper warnings for unknown files.
  9. Update the host when a new version is out.