Current location - Quotes Website - Collection of slogans - How does linux start nas service?
How does linux start nas service?
NAS server (Network Attached Storage) is a technology that integrates scattered and independent data into a large centralized management data center to facilitate access to different hosts and application servers.

System selection of Linux

I chose Ubuntu 18.04. But for NAS, it needs stability and few updates, so I recommend Arch Linux more. Simple and clean, it is best to reduce desktop configuration and GPU occupation.

system installation

Finished downloading. Iso file, burn to USB flash drive with UltraISO. Then restart, press F 12 to enter the BIOS, check the startup list, and open the UEFI startup option. Then save the settings and exit, press F8 to open the startup list, and select UEFI your USB flash drive. Enter the system, select the first item and install directly. As for the hard disk configuration, I only have one SSD and one HDD, so I installed the system on the SSD, let the installer partition it automatically, and the HDD automatically mounts it as a data disk. There is nothing to say about the rest, just move on to the next one according to your own needs.

SAMBA configuration

1. Install Ubuntu SAMBA server to update the software source code: enter the command sudo apt-get update to update the software source code.

Install SAMBA service: enter the command sudo apt-get install SAMBA to install SAMBA server.

Secondly, create SAMBA configuration file.

Back up the original configuration file: sudocp/etc/samba/smb.conf/etc/samba/smb.conf.bak.

Create a * * * shared directory: sudo mkdir-p/ your * * * shared folder path #mkdir -p is used to create a path that does not exist in the path.

Update directory permissions: sudo chmod-R 777/ your * * * shared folder path #chmod -R can change the permissions of your * * * shared directory and all its files and subdirectories. 777 means that all users have the right to read and write the directory.

Modify the configuration file: sudo vim /etc/samba/smb.conf # If there is no vim, please enter the command sudo apt-get vim vim.

After entering the configuration file, press the I key to enter the editing mode, delete all fields, and enter the following configuration (you can delete the comment text after the # symbol):

[Global] # Here is the global setting workgroup = WORKGROUP # with the same workgroup name as Windows security = user # Here is the access security level, and user is the lowest security level, so you need to enter a user name and password. (The sharing rights in the online tutorial have been turned off after the update. Enter the default maximum security level for sharing permissions. ) usershare owner only = false # Grant access to other devices public = yes browsable = yes[ your NAS name] # The following is the shared path configuration note = user's NAS # This paragraph is marked and has no influence on the configuration. Path =/your * * * shared folder path # write your own * * shared path read only = no # read only = yes # writable = yes # browsable = yes # browsable guest ok = yes # Can I use public = yes # for other users? Open createmask = 0777 # createpermission directorymask = 0777 # directorypermission valid users = user # Enter the current user name [your NAS name] # If you want to share the path separately on the same machine, please copy the above configuration here.

Third, create SAMBA users.

Input command

Sudo SMB passwd- user name

Attention! Please make sure that there is a linux user with the same name before creating samba user.

If you want to create another linux user to use samba, enter the command sudo adduser username to create a new user.

Four. Restart SAMBA service * Enter the command.

Sudo systemctl restarts smbd

Verb (short for verb) Check whether samba service is running * To check whether SAMBA service is running, enter the command:

System control state smbd

System control state nmbd

To enable these two services, run the following command:

Sudo system ctl starts smbd

Sudo system starts nmbd

After it starts running, smbd will listen on ports 139 and 445. If it is not accessible, you can check whether the port is blocked.

Arch users such as PS: Manjaro, please use the following command to enable samba service.

Enable SMB nbsystemctl to start SMB nmb VI. Access SAMBA folder from other devices * On a Windows device on the same network, open this pc, click the tab computer above, select Options Map Network Drive, and enter \ host IP # yournas IP address \ your * * * shared folder name in the file bar (root directory is not required here).

Then you can use it directly.

Reference article: Samba configuration and mapping in linux and windows file directories * * * Enjoy-windows [2013-01-21]. Please pay attention to the implementation results. If a prompt like install-tr-control-cn.sh.1appears, it means that the file already exists. If prompted. Sh-no-check-certificate exists and can be deleted by rm install-tr-control-cn.sh before downloading; Or add a -N parameter after wget, such as wget-n.sh-no-check-certificate 2. Execute the installation script.

Execute the installation script (if the system doesn't support the bash command, please try to change bash to sh): bashinstall-tr-control-cn.sh If the prompt such as permission rejection appears, it means that there is no permission, you can try to add the execution permission: chmod+xinstall-tr-control-cn.sh If the command is executed successfully, a text installation interface will appear: follow the prompt, enter the corresponding number, and press. After the installation is completed, use a browser to access the transport Web interface (for example, open the web manager of aria2. Open the settings in the upper right corner, and enter your NAS address and the port of aria2 profile. If there is no change, enter 6800.

When downloading aria2 plug-in in chrome, it is convenient to call aria2 directly to download things. If there is no response, you can directly copy the link and download it.

Third, the Docker Docker function is under study and will be updated later.

Reference article: ubuntu installation configuration Aria2 [2016-08-14]/p/3c1286c8a19d configuration NAS remote management.

First, about remote management.

Remote connection to Linux can be controlled by connecting terminals through SSH, and can also be controlled graphically through Webmin. Personally, SSH is more recommended. After all, Linux uses more commands, while Webmin is more intuitive.

Second, the configuration of SSH * Install SSH

Enter the command: sudo apt-get install ssh.

Start service: service sshd starts.

Configuration port: vim /etc/ssh/sshd_config.

Delete the comment key before the port and customize the port.

Check whether the service is started: ps -e | grep ssh.

As long as there are no errors and ssh-agent and sshd are running.

Windows downloads putty, enters your NAS address and port, and can remotely manage NAS hosts by using a terminal.

Third, website management.

*Webmin installation

Because there is no webmin in the source code of the package manager, we need to go to official website to download and install the software package, and use wget to download the software package:

CD/ your download directory

wget/web admin/web min _ 1.9 10 _ all . deb

Then run the installation command.

Dpkg-Install webmin _1.910 _ all.deb.

Setup will automatically install Webmin into the /usr/share/webmin directory. If there are no errors, you can enter-ssleay-perlopenssl libauthen-PAM-perllippam-runtime libio-pty-perlapt-show-versions python in other devices.

If the package cannot be found during the installation of the dependency library, please enter vim /etc/apt/sources.list to check whether the last line ends in universe.

When using NAS, you need to ensure that both NFS service and SMB service on NAS are started.

Then, you need to log in as a user on the NAS, using admin here:

# smbclient-l192.168.1.40-u admin Enter the password of the administrator: domain = [workgroup] OS = [UNIX] server = [samba4.1.20]. Sharename type note-IPC $ IPC IPC service () public disk project diskpm _ teamdiskmember disklayout _ teamdiskdomain = [workgroup] OS = [UNIX] server = [samba4.65433]

Explain that the connection is successful!

If you want to use storage in NAS, you need to mount it on a Linux server, for example:

# mount -o username=admin,password = * * * * * * * * * * * * *// 192. 168. 1.40/BackUp/mnt/nas BackUp/

Then you can use it.