ubuntu directory under the FTP file sharing

 

1. Install samba

>> sudo apt-get install samba
>> sudo apt-get install smbfs
2. Create a shared directory
>> mkdir /home/username/myshare
>> sudo chmod 777 /home/username/myshare
3. Modify the configuration file
>>sudo gedit /etc/samba/smb.conf
(1) If a visitor needs to enter a user name and password
In the approximate location of the 102-line "security = share" changed to "security = user", this sentence is likely to be annotated, but it was also possible to equal user, in short if you want to set up a user name and password, it's time for the user.
        Finally, add in the document:
[myshare]
path = /home/username/myshare
public = yes
writable = yes
valied user = username,username
Save, and enter:
>>sudo touch /etc/samba/smbpasswd
>> sudo smbpasswd -a username (When prompted for a password)
>>sudo service smbd restart
OK. Note that the above "username" changed your user name
(2) If a visitor does not need to enter a password
First modify the "security = share", added the final document
[myshare]
path = /home/username/myshare
read only = no
browsable = yes
guest ok = yes
>>sudo service smbd restart
 
 
Set ftp
1. Review the ftp port 21 is open
>>sudo netstat -tunlnp | grep 21
2. Install vsftp
>>sudo apt-get install vsftpd
2. Modify the login
>> we /etc/vsftpd.conf
By default, only support anonymous login, will anonymous_enable file = YES to NO
Then local_enable = YES Open.
 

 

Guess you like

Origin www.cnblogs.com/hanrp/p/11225343.html