美文网首页
【Raspberry Pi 树莓派】打开 Raspberry P

【Raspberry Pi 树莓派】打开 Raspberry P

作者: idengwei | 来源:发表于2024-01-04 23:33 被阅读0次

    操作步骤(需root用户权限):

    1. 通过apt安装samba服务,命令如下:
    sudo apt install samba
    
    1. 备份samba配置文件,命令如下:
    sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
    
    1. 打开samba配置文件,修改“[homes]”段中的“read only = no”为“read only = yes”,如下所示:
    [homes]
       comment = Home Directories
       browseable = no
    
    # By default, the home directories are exported read-only. Change the
    # next parameter to 'no' if you want to be able to write to them.
       read only = yes
    

    命令如下:

    sudo sed -i '/\[homes\]/,/read only = yes/s/read only = yes/read only = no/' /etc/samba/smb.conf
    
    1. 设置samba用户密码,命令如下:
    sudo smbpasswd -a pi
    

    在“New SMB password:”提示后输入要设置的密码

    命令合并如下:

    sudo apt-get install samba
    sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
    sudo sed -i '/\[homes\]/,/read only = yes/s/read only = yes/read only = no/' /etc/samba/smb.conf
    sudo smbpasswd -a pi
    

    在“New SMB password:”提示后输入要设置的密码

    相关文章

      网友评论

          本文标题:【Raspberry Pi 树莓派】打开 Raspberry P

          本文链接:https://www.haomeiwen.com/subject/sugbndtx.html