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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
01-05-2017, 10:58 AM
|
#1
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Rep:
|
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.
|
|
|
01-05-2017, 04:09 PM
|
#2
|
Moderator
Registered: Aug 2002
Posts: 26,191
|
Code:
smbclient //server_name_or_IP/share_name -U windows_username%windows_password -c "put <filename>"
|
|
1 members found this post helpful.
|
01-06-2017, 07:10 AM
|
#3
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Original Poster
Rep:
|
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.
|
|
|
01-06-2017, 07:16 AM
|
#4
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,733
|
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
|
|
|
01-06-2017, 07:43 AM
|
#5
|
Moderator
Registered: Aug 2002
Posts: 26,191
|
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.
|
|
|
01-06-2017, 08:02 AM
|
#6
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Original Poster
Rep:
|
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??????????
|
|
|
01-06-2017, 08:36 AM
|
#7
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Original Poster
Rep:
|
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
|
|
|
01-06-2017, 09:04 AM
|
#8
|
Moderator
Registered: Aug 2002
Posts: 26,191
|
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.
|
|
|
01-06-2017, 09:15 AM
|
#9
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Original Poster
Rep:
|
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>"
|
|
|
01-06-2017, 09:27 AM
|
#10
|
Moderator
Registered: Aug 2002
Posts: 26,191
|
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?
|
|
|
All times are GMT -5. The time now is 02:37 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|