Ini situasiku. Saya memiliki kotak server Windows dan kotak Linux. Di server Windows saya, saya telah menginstal Sharepoint dan dapat mengakses direktori bersama melalui baris perintah Windows dengan menjalankan dir
perintah dan juga dapat memetakan direktori bersama ke drive jaringan, keduanya secara lokal.
dir "\\XX.XX.XX.XX\DavWWWRoot\Shared Documents\AllDocuments\ImpDocuments"
Masalahnya muncul ketika saya mencoba mengakses yang sama dari kotak Linux di atas ssh.
ssh -v [email protected] cmd /c dir "\\\\XX.XX.XX.XX\\DavWWWRoot\\Shared Documents\\AllDocuments\\ImpDocuments"
Kesalahan: Access Denied.
Ide silakan!
OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010
debug1: Reading configuration data /etc/ssh/ssh_config`
debug1: Applying options for *
debug1: Connecting to XX.XX.XX.XX [XX.XX.XX.XX] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/identity type -1
debug1: identity file /root/.ssh/id_rsa type 1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version VShell_4_0_1_478 VShell
debug1: no match: VShell_4_0_1_478 VShell
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'XX.XX.XX.XX' is known and matches the DSA host key.
debug1: Found key in /root/.ssh/known_hosts:10
debug1: ssh_dss_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,gssapi-with-mic
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure. Minor code may provide more information
Cannot determine realm for numeric host address
debug1: Unspecified GSS failure. Minor code may provide more information
Cannot determine realm for numeric host address
debug1: Unspecified GSS failure. Minor code may provide more information
debug1: Unspecified GSS failure. Minor code may provide more information
Cannot determine realm for numeric host address
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/identity
debug1: Offering public key: /root/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password,gssapi-with-mic
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Next authentication method: password
[email protected]'s password:
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending command: cmd /c dir \\\\XX>XX.XX.XX\\DavWWWRoot\\Shared Documents\\AllDocuments\\ImpDocuments
Access is denied.
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 1824, received 1920 bytes, in 17.4 seconds
Bytes per second: sent 104.8, received 110.3
debug1: Exit status 1
Anda perlu memasang sistem file target pada sistem Linux sebelum mengaksesnya.
Kemudian Anda dapat menggunakan ls atau utilitas lain untuk melihat dan / atau mengedit file.
Dengan anggapan itu berfungsi, Anda dapat menambahkan mount ke file / etc / fstab sistem Linux untuk dipasang secara otomatis saat boot.
sumber
Mungkinkah ini salah ketik pada perintah yang Anda jalankan?
Jika bukan itu, saya akan mencoba mengutip perintah windows sehingga ssh melihatnya sebagai string tunggal. Anda mungkin harus bermain-main dengan menggandakan atau tidak menggandakan garis miring terbalik:
Jika ini masih tidak berhasil, coba buat koneksi SSH interaktif ke server windows, kemudian coba jalankan
dir
perintah di sesi itu. Mungkin server SSH Windows tidak mengatur sesi Anda dengan benar, dan Anda tidak memiliki akses ke jaringan ketika Anda datang dengan cara itu.sumber