日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 运维知识 > linux >内容正文

linux

虚拟机 Linux ubuntu16.04 对 windows 设置共享文件夹教程(samba)(ubuntu16.04换源【更换下载源】【更换源】【更新源】)(如果连不上需要开SSH服务)

發(fā)布時(shí)間:2025/3/20 linux 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 虚拟机 Linux ubuntu16.04 对 windows 设置共享文件夹教程(samba)(ubuntu16.04换源【更换下载源】【更换源】【更新源】)(如果连不上需要开SSH服务) 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

文章目錄

    • 20220324 其實(shí)它這個(gè)換源貌似也沒(méi)必要直接修改配置文件,在ubuntu設(shè)置里也能更換源
    • 安裝
    • 配置(用戶不要寫(xiě)yg,寫(xiě)你自己的!)
    • 換源
      • 1、備份原始文件
      • 2、打開(kāi)文件
      • 3、注釋原文件內(nèi)容添加新地址
      • 4、保存退出
      • 5、更新源
      • 6、更新軟件(不知道干嘛的?)
    • SSH服務(wù)
    • 20220323 如果還不行,那就是虛擬機(jī)apt安裝的依賴有問(wèn)題了,需要purge 這個(gè) appstreamcli,然后autoremove再u(mài)pgrade一下

20220324 其實(shí)它這個(gè)換源貌似也沒(méi)必要直接修改配置文件,在ubuntu設(shè)置里也能更換源

安裝

安裝samba服務(wù)器

sudo apt-get install samba

– sudo apt-get update –

配置(用戶不要寫(xiě)yg,寫(xiě)你自己的!)

mkdir /home/yg/share

更改權(quán)限

sudo chmod 777 /home/yg/share

備份配置文件

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak

修改配置文件

sudo gedit /etc/samba/smb.conf

在文末添加(最后一行貌似不要也行)

[winshare] path = /home/yg/share available = yes browseable = yes public = yes writable = yes valid users = yg

20220211(改):我前面設(shè)置valid users = yg一直搞不定。。。后面干脆不設(shè)置valid users,結(jié)果全公司都能訪問(wèn)到我的共享文件了,后面干脆搞個(gè)單一共享ip得了
hosts allow = 192.168.1.116
參考文章:在share級(jí)別配置samba使其實(shí)現(xiàn)只允許某些ip訪問(wèn)

[winshare] path = /home/yg/share available = yes browseable = yes public = yes writable = yes hosts allow = 192.168.1.116 yg@ubuntu:~$ sudo /etc/init.d/samba restart [ ok ] Restarting nmbd (via systemctl): nmbd.service. [ ok ] Restarting smbd (via systemctl): smbd.service. [ ok ] Restarting samba-ad-dc (via systemctl): samba-ad-dc.service.

windows上鍵入ip地址

如果windows拒絕訪問(wèn)請(qǐng)?jiān)趗buntu上卸載samba并換源重新安裝samba,因?yàn)槟阒苯佑美显窗惭b的可能不太行(袁總說(shuō)的)。。。。竟然有這種事

換源

如果apt update或者apt安裝東西出錯(cuò),按下面步驟換源就完了

參考文章:Ubuntu 更換下載源

1、備份原始文件

sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup

2、打開(kāi)文件

vi /etc/apt/sources.list

3、注釋原文件內(nèi)容添加新地址

新20220211

#阿里云 deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

下面是版本1

# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties deb http://mirrors.aliyun.com/ubuntu/ xenial universe deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties deb http://archive.canonical.com/ubuntu xenial partner deb-src http://archive.canonical.com/ubuntu xenial partner deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse

4、保存退出

ESC + : + wq

5、更新源

sudo apt-get update

6、更新軟件(不知道干嘛的?)

sudo apt-get dist-upgrade sudo apt-get upgrade

參考文章:二. Ubuntu下安裝samba服務(wù)器

SSH服務(wù)

參考文章:xshell安裝與配置,Xftp(不能連接虛擬機(jī)解決方法,sudo apt-get install openssh-server,服務(wù)沒(méi)開(kāi)怎么傳輸數(shù)據(jù)?!)

20220323 如果還不行,那就是虛擬機(jī)apt安裝的依賴有問(wèn)題了,需要purge 這個(gè) appstreamcli,然后autoremove再u(mài)pgrade一下

與50位技術(shù)專(zhuān)家面對(duì)面20年技術(shù)見(jiàn)證,附贈(zèng)技術(shù)全景圖

總結(jié)

以上是生活随笔為你收集整理的虚拟机 Linux ubuntu16.04 对 windows 设置共享文件夹教程(samba)(ubuntu16.04换源【更换下载源】【更换源】【更新源】)(如果连不上需要开SSH服务)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。