net use this command is only available under windows.
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
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
- How to Fix Ubuntu(Linux) mount error(22)
- Linux changing password enter new UNIX password: passwd: authentication token manipulation error
- Linux Nagios failed to log in to internal server error (Fixed)
- How to Fix No default.conf file in conf.d after Installing Nginx
- Notes on Linux SCP command using specific port
- [Solved] Error during installation of nginx: Make: * * * [build] error 2
- [SSH error] ssh_exchange_identification: read: Connection reset by peer
- [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
- How to Solve Error: Driver “kvm2“ not found
- [Solved] SSH WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
- [Solved] Git Error: OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
- Enter passphrase for key ‘/c/Users/**/.ssh/id_rsa‘ [How to Solve]
- AFTER THE GIT SOURCE CODE IS INSTALLED, AN ERROR IS REPORTED /USR/BIN/GIT: NO SUCH FILE OR DIRECTORY
- Git Error Resolution: errno:10054 Time out
- Docker Run ‘echo core ＞ /proc/sys/kernel/core_pattern‘ Error
- [Solved] Login with Ubuntu graphical interface, error sorry, that didn’t work.please try again
- Error: EACCES: permission denied, unlink ‘xxxx/xxxx/xxxx‘ [How to Solve]
- Problem solving / etc/ rc.local The boot entry of the file configuration is invalid
- Push to origin/Master was rejected [How to Solve]
- Solve the problem of 404 Not Found error in nginx accessing dynamic interface