|
|
|
sudo apt update && sudo apt install apt-offline -y |
|
sudo apt-offline set --update --upgrade apt-offline.sig |
|
sudo apt-offline get apt-offline.sig --bundle bundle.zip |
|
|
|
# Transfer bundle.zip to air-gapped via USB. |
|
# On air-gapped: |
|
|
|
sudo apt-offline install bundle.zip |
|
|
|
sudo apt-offline set --install-packages samba apt-offline.sig |
|
|
|
# Transfer apt-offline.sig to connected machine via USB. |
|
On connected: |
|
|
|
sudo apt-offline get apt-offline.sig --bundle bundle.zip |
|
|
|
# Transfer bundle.zip back to air-gapped. |
|
# On air-gapped: |
|
|
|
sudo apt-offline install bundle.zip |
|
|
|
# Proceed with Share CreationCreate shared directory: |
|
|
|
sudo mkdir /shared |
|
sudo chown nobody:nogroup /shared |
|
sudo chmod 0775 /shared |
|
|
|
# Backup and edit Samba config: |
|
|
|
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak |
|
sudo nano /etc/samba/smb.conf |
|
|
|
# Add at end: |
|
|
|
[shared] |
|
comment = Shared Folder |
|
path = /shared |
|
browsable = yes |
|
guest ok = no |
|
read only = no |
|
create mask = 0755 |
|
|
|
# Test config and restart Samba: |
|
|
|
sudo testparm |
|
sudo systemctl restart smbd |
|
sudo systemctl enable smbd |
|
|
|
# Set Samba password (replace yourusername): |
|
|
|
sudo smbpasswd -a yourusername |
|
|
|
# Delete the Network Share on Air-Gapped UbuntuEdit Samba config: |
|
|
|
sudo nano /etc/samba/smb.conf |
|
|
|
# Delete [shared] section. Test config and restart Samba: |
|
|
|
sudo testparm |
|
sudo systemctl restart smbd |
|
|
|
# Remove directory: |
|
|
|
sudo rmdir /shared |
|
|
|
# (Optional) Restore config: |
|
|
|
sudo mv /etc/samba/smb.conf.bak /etc/samba/smb.conf |
|
sudo systemctl restart smbd |
|
|
|
# (Optional) Uninstall Samba: |
|
|
|
sudo apt-offline set --install-packages samba apt-offline.sig # Generate sig for removal (use --uninstall-packages if supported, else manual) |
|
|
|
# Transfer sig to connected, get bundle, install on air-gapped: |
|
|
|
sudo apt-offline install bundle.zip |
|
sudo apt purge samba -y |
|
sudo apt autoremove -y |
|
|