Debian series automatically mount SMB at startup
本文最后更新于 437 天前,其中的信息可能已经有所发展或是发生改变,如有失效可到评论区留言。

I have previously written an article about how to mount a shared SMB folder on macOS (see:How to automatically load SMB shared network disks when macOS starts up ), and this article will briefly explain how to mount the SMB folder on the Debian 12 system at startup.

First install the required components:

apt-get install cifs-utils apt install samba-client

After the installation is complete, you can use the following command to verify whether you can log in to the corresponding shared device, such as nas:

smbclient -L your-ip -U username

Then create the mount directory:

mkdir /mnt/share

Mount the shared directory to the /mnt/share directory created earlier:

mount -o username=account,password=password//your-ip/shared directory/mnt/share

Note: If the debian12 here is LXC (linux container), the following error may be reported:

mount error(1): Operation not permitted lxc

This means that the LXC is an unprivileged container. So if you want to use the method in this article, you need to use a privileged LXC. If it is not a privileged container, there are other ways to implement it. I will write another article to talk about it later.

can usedf -hcommand to check whether the mount is successful.

If you want to set it to automatically mount at startup, you need to editetc/fstabdocument:

vim /etc/fstab

Then add the following configuration to the last line of the file, save and exit:

//your-ip/shared directory/mnt/share cifs defaults,username=account,password=password

at lastrebootPost-usedf -hCheck whether the mount is effective.

The content of the blog is original. Please indicate the source when reprinting! For more blog articles, you can go toSitemapUnderstand. The RSS address of the blog is:https://blog.tangwudi.com/feed, welcome to subscribe; if necessary, you can joinTelegram GroupDiscuss the problem together.
No Comments

Send Comment Edit Comment


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠(ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ°Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
Emoticons
Emoji
Little Dinosaur
flower!
Previous
Next
       

This site has disabled the right mouse button and various shortcut keys. The code block content can be copied directly by clicking the copy button in the upper right corner

en_US