Nodejs deployment and configuration of samba in Ubuntu

Source: Internet
Author: User

in the Ubuntu installed on Samba

When you install Samba on 10.04, the samba is uninstalled first, otherwise it will affect the subsequent installation.

0. Uninstalling Samba

sudo apt-get remove Samba-common

sudo apt-get remove smbclient

sudo apt-get remove Samba

I. Installation of Ubuntu SAMBA configuration:

sudo apt-get Insall Samba

sudo apt-get insall cifs-utils

Two. Create a shared directory: (Administrator privileges)

Mkdir/home/share

sudo chmod 777/home/share

Three. Create an Ubuntu Samba profile:

1. Modify the current configuration file

sudo vi/etc/samba/smb.conf

Last added in smb.conf

[Share]

Path =/home/share

Available = yes

Browsealbe = yes

Public = yes

writable = yes



Four. Restart Ubuntu Samba Server

SUDO/ETC/INIT.D/SMBD restart



Five. Ubuntu Samba configuration test

Smbclient-l//localhost/share

This problem occurs during testing

Workaround:

Sudoapt-get Install Smbclient

Sudoapt-get Install Samba4-client

After that the test passed, the reason is that there is no installation of the above two software.

192.168.168.130
--------------------------------------------------------------------------------------------------------------- -------------------

Six, Ubuntusamba configuration use

Turn on my Computer, select tools, Map network drives (N)

, enter \ \ Your virtual machine ip\share and press ENTER at the end of the folder.

You can use it.

When you go back to the computer, you'll get more of this stuff, and that's where you share your network.

Note: Sometimes even if you have Samba installed, you can see things that are shared with Linux under Windows, but you can't manipulate these shared files under Windows, the solution to this problem is to When modifying smb.conf, there is a problem with the modification, depending on the situation of the specific analysis, can be modified as follows:

[Share]

Comment=linux Share

Path=/home/share

Create mask=0700

Directory Mask =0700

Force User=nobody

Force Droup =nogroup

Available=yes

Browseable=yes

Writeable=yes

Guest Ok=yes

There are times when you need to build a different user.

Four. Create an Ubuntu Samba account

sudo touch/etc/samba/smbpasswd

sudo smbpasswd-a phinecos

You will then be asked to enter the password for your Samba account

If there is no fourth step, when you log in you will be prompted to the session setup Failed:nt_status_logon_failure]

------------------------------------------------------------------------------------------Ubuntu How to modify the superuser password

Some versions of Ubuntu's super users are hidden, but a lot of places have to use this super user privileges. We can set up super users like this:

...: ~$ sudo passwd

Password: Enter the password for the user at the time of installation

Enter New UNIX Password:-User password for root

Retype new UNIX Password: Re-duplicate the root user password

passwd: Password has been successfully updated

This completes the super user's settings. Can enter:

...... : ~$ Su–root (appears to be direct SU)

"~$" becomes "~#" so you switch to advanced users.

--------------------------------------------------------------------------------------------------------------- ------------------

Browse for installed programs. To view the list of installed packages, enter the following command. Note the name of the package that you want to uninstall.


    1. Dpkg--list

Uninstall the program and all configuration files. In the terminal, enter the following command to replace <programname> with the one you want to completely remove:

Sudoapt-get--purge Remove <programname>

Uninstall the program only. If you remove the program but leave the configuration file, enter the following command:

Sudoapt-get Remove <programname>

Solve the problem of the VI in Ubuntu can not use the arrow keys and BACKSPACE

Programme one:

Problem:

Ubuntu VI in the editing state of the arrow keys can not be used, as well as the grid key can not be deleted and so we are accustomed to some of the keys can not be used.

Workaround:

The vim full version can be installed, the keyboard is normal under the full version, and the VI command is also used after installation.

Install Vim:

Ubuntu is preinstalled with the Vim tiny version, and requires the Vimfull version. Execute the following statement to install the VIM full version:

$sudo Apt-get Remove Vim-common

$sudo Apt-get Install Vim

This will do, Vim is an excellent software, can be realized in the application.

Installing NODEJS and configuring environment variables under Linux (ubuntu16.04)

In particular, after configuring the/etc/profile, add the configuration to the/ROOT/.BASHRC; otherwise, the configured environment variables will not take effect under the root account

Download the Nodejs source code node-v5.1.0-linux-x64.tar.gz on the NODEJS official website, go to the/OPT directory; Enter the/OPT directory and enter the command:

TAR-ZXF node-v5.1.0-linux-x64.tar.gz, unzip the file to the current directory

    1. (This step can save) the input command: MV node-v5.1.0-linux-x64.tar.gz node, renaming the file to node
    2. Input command: Vim/etc/profile (if Vim is not installed, can be installed according to the prompts, Vim is more useful than VI), add the following three lines at the end:

Export Node_home=/opt/node

Exportpath= $PATH: $NODE _home/bin

Exportnode_path= $NODE _home/lib/node_modules

Then press the ESC key and enter ": wq!" command to save the configuration and launch

    1. At the command line input: Source/etc/profile, and then at the command line input: Node-v, return the version information v5.1.0, indicating that the environment variable configuration will take effect; but you will find that it is not effective to enter the root account
    2. Enter: VIM/ROOT/.BASHRC at the command line and add a line at the end of the file
    3. SOURCE Etc/profile command, save. That's it.
    4. Are you sure? Encountered: When root and normal user switch, node-v no information.

Resolve Settings Nodejs Global variables,

Ln-s/root/node/bin/node/sbin/node

Ln-s/root/node/bin/npm/sbin/node

Global Environment using node and NPM

LN is a very important command in Linux, its function is to create a file in another location with a link, the most common parameter of this command is-s, (Symbolic code meaning)
The specific usage is: Ln-s source file Destination file

/usr/local/bin This path is in the global variable path, so you can use node and NPM globally using the following command
However, the disadvantage is that you cannot use other NPM-installed plugins globally unless you create a link as follows

ln -s /usr/local/src/nodejs/bin/node /usr/local/bin/nodeln -s /usr/local/src/nodejs/bin/npm /usr/local/bin/npm

Set environment variables and add them to the root directory/etc/profile

    1. Export Node_home =/root/node
    2. Export PATH = $node _home/bin: $PAT

NPM i npm @lastest-G

Nodejs deployment and configuration of samba in Ubuntu

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.