Scheme I
net use
this command is only available under windows.
Scheme II
sudo mount -t cifs -o username=administrator,password=password //remote_ share_ server_ ip/share_ Dir./data
this command must use root permission. It cannot be implemented for applications that cannot use root permission. If there is no sudo, an error will be reported:
mount: only root can use "-- options" option
Programme III
Python package pysmb
def check_unc_source(self, unc_path, username, password):
conn = SMBConnection(username, password, '', remote_name, is_direct_tcp=True)
result = conn.connect('remote_share_server_ip', 445)
with open("local_file", "wb") as local_file:
conn.retrieveFile("share_dir", "file", local_file)
The 4th parameter of SMBConnection, remote_name:
The NetBIOS machine name of the remote server.
On windows, you can find out the machine name by right-clicking on the “My Computer” and selecting “Properties”.
This parameter must be the same as what has been configured on the remote server, or else the connection will be rejected.
You can actually fill in the IP address of the server where the Windows remote shared directory is located, i.e. the same as the first parameter remote_share_server_ip of conn.connect, if it is empty, an error will be reported:
smb.smb_structs.OperationFailure: Failed to retrieve [file] on share_dir: Unable to connect to shared device
Read More:
- [Solved] ××: error while loading shared libraries: ××.so.19: cannot open shared object file: No such file or directory
- Error: loading shared libraries: cannot open shared object file: No such file or directory
- [Solved] /usr/local/libexec/mecab/mecab-dict-index: error while loading shared libraries: libmecab.so.2: cannot open shared object file: No such file or directory
- [Solved] Ubuntu Compile AOSP Error: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
- [Solved] Linux — 9 — txt files are copied from windows to Linux and read error
- Linux Ubuntu Django Error: uwsgi: error while loading shared libraries: libpcre.so.1
- [Solved] mongod: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No s
- [Solved] error while loading shared libraries: libmysqlclient.so.20: cannot open shared object file: No such…
- VScode connect Remote Linux Server Error: Resolver error: Error
- [Solved] error while loading shared libraries: libjson.so.0: cannot open shared object file: No such file or
- Linux Ubuntu ImportError: Libtk8.5.so: cannot open shared object file:No such file Install tkinter Library
- [Solved] error while loading shared libraries: libmpc.so.3: cannot open shared object file
- [Solved] Python Import mmcv Warning: ImportError: libGL.so.1: cannot open shared object file: No such file or directory
- Linux Execution Error “service mysqld start“error while loading shared libraries: libaio.so.1“
- [Solved] fatal error: linux/videodev.h: No such file or directory
- Linux system service command error: Failed to allocate directory watch: Too many open files
- Docker Startup Error: standard_init_linux.go:211: exec user process caused “no such file or directory”
- Centos7.2 Install vscode Error: error while loading shared libraries: libxkbcommon.so.0: cannot open shared pro
- [Solved] git error – remote: http basic: access denied
- [Solved] pxp_lib.h:19:10: fatal error: linux/pxp_device.h: No such file or directory