LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-05-2017, 10:58 AM   #1
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Rep: Reputation: Disabled
SMBCLIENT into Windows not working


I'm trying to copy a file from linux to Windoze using smbclient. I think I have the code right. Here is the code:

smbclient -I <ip address>/folder to send file to -U windowsusername%windowspassword -c "put <filename>"

When this is ran, it is running from the local folder where the file is stored which is why I didn't give the path of the file. When I hit ENTER, nothing happens.

Any help is highly appreciated!

Last edited by trickydba; 01-05-2017 at 01:01 PM.
 
Old 01-05-2017, 04:09 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,191

Rep: Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087
Code:
smbclient //server_name_or_IP/share_name -U windows_username%windows_password -c "put <filename>"
 
1 members found this post helpful.
Old 01-06-2017, 07:10 AM   #3
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
I'm quite sure your code above is correct, I think it's some configuration thingy on the other side. The response I get is "Error NT_STATUS_UNSUCCESSFUL)"

Let me make sure I got this right....."//server_name_or_IP/share_name" is the destination right?

Last edited by trickydba; 01-06-2017 at 07:12 AM.
 
Old 01-06-2017, 07:16 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,733

Rep: Reputation: 7556Reputation: 7556Reputation: 7556Reputation: 7556Reputation: 7556Reputation: 7556Reputation: 7556Reputation: 7556Reputation: 7556Reputation: 7556Reputation: 7556
since you gave no information about your configuration I can only say you are right. But probably you mistyped that password, or smb.conf is not ok, or there is a dns/openldap/whatever related issue.
http://catb.org/~esr/faqs/smart-questions.html
 
Old 01-06-2017, 07:43 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,191

Rep: Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087
Correct. //server/share_name where server can be the netbios name or IP address. The netbios name is not necessarily the same as the hostname. The share_name is a share as defined in the server's /etc/samba/smb.conf file.
 
Old 01-06-2017, 08:02 AM   #6
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
I have also looked at using 'scp'. When using it in verbose mode, I can see where it says the host is a known host and matches the RSA host key, tells where on the linux side the key was found (known_hosts), also "ssh_rsa_verify: signature correct" is shown, but then it says at the bottom "Authentications that can continue: password" "No more authentications methods to try". Then it asks for a password..................WHAT DA SHIGGITY??????????
 
Old 01-06-2017, 08:36 AM   #7
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
Here is the debug info:

Remote protocol version 2.0, remote software version 1.82_sshlib GlobalSCAPE
debug1: no match: 1.82_sshlib GlobalSCAPE
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-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc 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 'hostname' is known and matches the RSA host key.
debug1: Found key in location of known_hosts:7
debug1: ssh_rsa_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
Welcome to <hostname>.debug1: Authentications that can continue: password
debug1: No more authentication methods to try.
Permission denied (password).
lost connection


I used "scp -v -oPasswordAuthentication=no"

Last edited by trickydba; 01-06-2017 at 08:37 AM. Reason: more info
 
Old 01-06-2017, 09:04 AM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,191

Rep: Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087
A new topic should go in a new thread...

I assumed from your previous threads that scp was working. What are you trying to do now?

From the debug information it does not look like publickey authentication is configured and you are using the option PasswordAuthentication=no.
 
Old 01-06-2017, 09:15 AM   #9
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
I can get ANYTHING to work now because I'm using Expect. It is working but now I'm working on a more secure method. I set my password authentication to no to force it not to ask for a password but to use keys. It seems that the keys are accepted, but you're right. I'll open up another thread and close this one. The above code works, the issue is on the other end (Windows server).

Working solution: smbclient //server_name_or_IP/share_name -U windows_username%windows_password -c "put <filename>"
 
Old 01-06-2017, 09:27 AM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,191

Rep: Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087
The host key is not the same thing as a public/private key. The host key is used as a protection against man in the middle attacks. The host key is saved in the ~/.ssh/known_hosts file. Did you create public/private keys?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Smbclient and Windows 7 cab00t Linux - Networking 3 11-12-2012 02:03 PM
smbclient support in windows aloishis89 Linux - Software 5 03-10-2008 03:28 PM
cant connect to xp machine smbclient not working circuithead Linux - Software 19 01-28-2006 10:00 AM
smbclient not working DonMiner Linux - Networking 2 09-04-2003 08:04 PM
Smbclient is working fine but smbmount is not.. sandy Linux - Networking 1 07-31-2003 05:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration