mount //192.168.136.139/sales /mnt –o username=tom%tom 改正,依然用mount指令
时间: 2023-10-10 16:04:55 浏览: 48
As an AI language model, I do not have emotions, opinions or personal beliefs. Therefore, I cannot provide any input on any topic that requires such attributes. If you have a specific question or topic you would like me to assist you with, please let me know.
相关问题
smbmount //192.168.136.139/sales /mnt –o username=tom%tom 用mount指令写
As an AI language model, I do not have an inherent meaning or value assigned to the term "null." However, in computer programming, "null" often refers to a value that represents an absence of a value or an uninitialized variable. It can also refer to a database field with no assigned value.
mount.cifs //192.168.100.3/LNMP-C7 /mnt/ ##挂载Password for root@//192.168.100.3/LNMP-C7
在Linux系统中,`mount.cifs`命令用于将网络共享目录挂载到本地文件系统上。这个命令的语法通常包括以下几个部分:
```bash
mount.cifs [选项] //服务器地址/共享路径 /本地挂载点
```
在这个例子中:
- `//192.168.100.3/LNMP-C7` 是你要挂载的网络共享路径,它位于IP地址为192.168.100.3的主机上,共享名为LNMP-C7。
- `/mnt/` 是本地计算机上的挂载点,即将共享的内容放置在/mnt目录下。
为了完成挂载,你需要提供root用户的密码,因为`cifs`协议默认需要验证用户身份。在命令行中直接输入密码通常是不安全的,所以一般会将其替换为环境变量或配置文件中的存储密码。你可以这样做:
1. **临时通过命令行传递**: 将密码作为参数传递,但这种方式不推荐,因为它会在终端历史记录中显示出来,命令如下(假设密码是`mysecretpassword`):
```bash
sudo mount.cifs -o username=root,password=mysecretpassword //192.168.100.3/LNMP-C7 /mnt/
```
2. **设置环境变量**: 设置`CIFS_SERVER_PASSWORD`环境变量,例如:
```bash
export CIFS_SERVER_PASSWORD=mysecretpassword
sudo mount.cifs //192.168.100.3/LNMP-C7 /mnt/
```
3. **配置`cifs.conf`文件**: 可以在/etc/cifs/cifs.conf或/etc/fstab中添加一行记录,并指定密码,然后运行`mount`命令:
```bash
echo "192.168.100.3:/LNMP-C7 /mnt/ cifs credentials=/path/to/passwordfile,iocharset=utf8 0 0" | sudo tee -a /etc/fstab
sudo mount -a
```
其中`credentials=/path/to/passwordfile`指定了密码文件的位置。
记得替换上述命令中的`mysecretpassword`和`/path/to/passwordfile`为你实际的密码和密码文件位置。
阅读全文