Share folders from your Linux computer
Follow these six steps on the Linux machine whose files you want to share over a USB4 or Thunderbolt cable:
- Check that Thunderbolt networking is active (
lsmod | grep thunderbolt_net; if missing, runsudo modprobe thunderbolt thunderbolt_net) and verify the other computer is authorized (cat /sys/bus/thunderbolt/devices/*/authorizedshould return1). - Check
ip addr show thunderbolt0for an IPv4 address.No normal IP address by defaultLinux often bringsthunderbolt0up with only an IPv6 address (fe80::) and no169.254IPv4 address. Open Network Settings and set IPv4 to Link-Local Only, or set fixed IP addresses on both computers. - Install Samba (
sudo apt install sambaon Ubuntu/Debian orsudo dnf install sambaon Fedora) and edit/etc/samba/smb.confto add your shared folder.Visible on Wi-Fi tooBy default, Samba listens on Wi-Fi and Ethernet too — not just the USB-C cable. To keep it cable-only, addinterfaces = lo thunderbolt0andbind interfaces only = yesunder[global]. For Mac compatibility and clean permissions, also addvfs objects = fruit streams_xattr,create mask = 0664,directory mask = 0775, andinherit permissions = yes. - Create a separate Samba password with
sudo smbpasswd -a $USER(Samba ignores your normal Linux login password), then restart it (sudo systemctl restart smbdorsmb). - Allow port
445strictly on the cable in your firewall:sudo ufw allow in on thunderbolt0 to any port 445 proto tcp(UFW) orsudo firewall-cmd --zone=trusted --add-interface=thunderbolt0 --permanent && sudo firewall-cmd --reload(firewalld). - Breaks after sleepOn some Linux laptops, waking from sleep drops the Thunderbolt connection and freezes open shared folders until you rescan
/sys/bus/thunderbolt/switches/0-0/rescanor unplug and replug the cable.
Connect from Linux (Files / Nautilus)
Follow these two steps on the Linux computer you want to copy files onto or browse from:
- Open your file manager (Files), press
Ctrl + L, typesmb://169.254.x.x, and press Enter. - Choose Registered User and enter the other computer’s account name and real password (not a Windows PIN, and avoiding computer names that may route over Wi-Fi).
Also setting up the other computer?
If your second computer runs a different operating system, open its setup guide too — or read the main file-sharing overview for cross-OS security risks and speed limits:
- How to set up network file sharing on Mac →
- How to set up network file sharing on Windows 11 →
- USB-C file transfer troubleshooting →
Questions and answers
Does Linux Samba listen on Wi-Fi too when sharing over a Thunderbolt cable?
Yes, by default Samba listens on every network interface including Wi-Fi and Ethernet. To restrict it strictly to the USB-C cable, add interfaces = lo thunderbolt0 and bind interfaces only = yes under [global] in /etc/samba/smb.conf, and allow port 445 only on thunderbolt0 in UFW or firewalld.
Why does thunderbolt0 on Linux have no 169.254 IPv4 address?
NetworkManager often brings thunderbolt0 up with only an IPv6 link-local (fe80::) address. Open your desktop’s Network Settings for the Thunderbolt connection and set IPv4 to Link-Local Only (or assign matching static IPs on both computers).
Why doesn’t my normal Linux login password work with Samba?
Samba keeps its own separate password database and ignores your normal Linux account password until you create one with sudo smbpasswd -a $USER and restart smbd.