UniLinuX

 

 

SAMBA

apt-get update && apt-get install samba samba-common-bin libpam-smbpass
apt install cifs-utils samba-client -y

apt-get install samba smbclient cifs-utils
apt-get install samba samba-common

 

Create a user for samba only (CLI)

useradd

-useradd -m -d /sambashare/usernameshare sambausername;

-useradd -M -s /sbin/nologin sambausername.

adduser

-adduser –no-create-home –disabled-password –disabled-login sambausername

-adduser –no-create-home –shell /usr/sbin/nologin sambausername

deluser

deluser sambausername

groupadd

groupadd group

gpasswd -d sambausername group – remove the sambausername from the named group.

smbpasswd -a sambausername

smbpasswd -e sambausername

usermod -aG groupshare sambausername

chmodmodify file access rights

chmod -R g+rwx /sambashare/usernameshare

chownchange file ownership

chown :group /sambashare/usernameshare

 

Disable network manager (permanently)

The method depends on desktop environment:

  • For Ubuntu MATE 18.04 LTS and 20.04 LTS purging network-manager package is safe. You can simply run:
    sudo apt-get purge network-manager
    
  • For Ubuntu 18.04 LTS and 20.04 LTS with GNOME desktop purging network-manager package will also purge ubuntu-desktop and gnome-control-center (essential part of GNOME desktop). So it is not an option.

    Here you should disable NetworkManager service (as you have already done):

    sudo systemctl stop NetworkManager.service
    sudo systemctl disable NetworkManager.service
    

    and three more services:

    sudo systemctl stop NetworkManager-wait-online.service
    sudo systemctl disable NetworkManager-wait-online.service
    
    sudo systemctl stop NetworkManager-dispatcher.service
    sudo systemctl disable NetworkManager-dispatcher.service
    
    sudo systemctl stop network-manager.service
    sudo systemctl disable network-manager.service
    

    and then reboot.