Score:1

Cannot access samba from outside LAN

bf flag

I have samba server running on Ubuntu 22.04. I wish to access it from external machines. If a device is on the same local network I am able to open the smbd:// network address no problem (using the external ip and/or its local ip.) I have allowed TCP 139 and 445 as well as UDP 137 and 138 through ufw and have my router forwarding these ports to the server as well, however when I use a port scanner from my cellphone they do not list as open. I do not know if they are closed or just nothing listening. Disabling ufw does nothing to improve the situation.

I am able to ping the server (as well as ssh in) from external network devices (such as my phone w/o wifi on.)

Here is the port forwarding rules from the router

systemctl (I am seeing that my session is shut down immediately?)

● smbd.service - Samba SMB Daemon
 Loaded: loaded (/lib/systemd/system/smbd.service; enabled; vendor preset: enabled)
 Active: active (running) since Wed 2023-08-02 04:45:39 UTC; 17min ago
   Docs: man:smbd(8)
         man:samba(7)
         man:smb.conf(5)
Process: 53510 ExecStartPre=/usr/share/samba/update-apparmor-samba-profile 

(code=exited, status=0/SUCCESS)
   Main PID: 53520 (smbd)
     Status: "smbd: ready to serve connections..."
      Tasks: 4 (limit: 8768)
     Memory: 49.1M
        CPU: 15.444s
     CGroup: /system.slice/smbd.service
             ├─53520 /usr/sbin/smbd --foreground --no-process-group
             ├─53522 /usr/sbin/smbd --foreground --no-process-group
             ├─53523 /usr/sbin/smbd --foreground --no-process-group
             └─53524 /usr/lib/x86_64-linux-gnu/samba/samba-bgqd --ready-signal-fd=45 --parent-watch-fd=11 --debuglevel=0 -F

Aug 02 04:45:39 cokutau systemd[1]: Starting Samba SMB Daemon...
Aug 02 04:45:39 cokutau systemd[1]: Started Samba SMB Daemon.
Aug 02 04:46:16 cokutau smbd[53528]: pam_unix(samba:session): session closed for user nobody
Aug 02 04:46:16 cokutau smbd[53529]: pam_unix(samba:session): session opened for user kevin(uid=1000) by (uid=0)
Aug 02 04:52:06 cokutau smbd[53529]: pam_unix(samba:session): session closed for user kevin
Aug 02 04:56:23 cokutau smbd[53566]: pam_unix(samba:session): session closed for user nobody
Aug 02 04:57:08 cokutau smbd[53568]: pam_unix(samba:session): session closed for user nobody
Aug 02 04:58:04 cokutau smbd[53570]: pam_unix(samba:session): session closed for user nobody

Any other commands that would be helpful to see?

Thank you for any and all advice!

Serve Laurijssen avatar
mg flag
Does this help? https://askubuntu.com/questions/583731/samba-keeps-warning-session-closed-for-user-nobody-why
tehbrozor avatar
bf flag
I made those changes and still cannot access using VLC for Android. I was able to try from a smart tv and it works, not sure if these changes made it work or if my trouble was just with VLC for Android this whole time. I will take that up on another thread.
tehbrozor avatar
bf flag
Followed the link posed by Serve Laurijssen https://askubuntu.com/questions/583731/samba-keeps-warning-session-closed-for-user-nobody-why I made those changes and still cannot access using VLC for Android. I was able to try from a smart tv and it works, not sure if these changes made it work or if my trouble was just with VLC for Android this whole time. I will take that up on another thread.
Organic Marble avatar
us flag
I connect to my server with a VPN and then I can access all shares.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.