Posted: . At: 12:06 PM. This was 10 years ago. Post ID: 7507
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.

Getting information from a Windows machine using the net command on Linux.

The net command may be used to get information from a Windows PC. Below is an example. I am reading the time from a Windows 7 Ultimate PC.

root@debian:/home/homer# net time -I 192.168.100.5
Fri Jul 11 11:22:32 2014

This command shows the network shares that my Windows 7 Ultimate installation has, I am connected to the shares on my Debian PC.

root@debian:/home/homer# smbtree -S 192.168.100.5
Enter root's password: 
WORKGROUP
	\\READYSHARE     		readyshare
	\\HOMER-PC       		
DUCKTALES
	\\BEJIITAS       		
BIGRIGS
	\\DEBIAN         		debian server

Here is how to change a remote Windows PC password using Samba.

root@debian:/home/homer# smbpasswd -U homer -r 192.168.100.5
Old SMB password:
New SMB password:
Retype new SMB password:
Password changed for user homer on 192.168.100.5.

This is a good way to reset a Windows password if you cannot actually get to the machine; but you have network access.

The command below shows how to download a file from a fileshare on a Windows machine using Samba.

root@debian:/home/homer# smbget smb://homer-PC/users/homer/Desktop/net.txt
Username for users at homer-PC [guest] homer
Password for users at homer-PC: 
Using workgroup BIGRIGS, user homer
smb://homer-PC/users/homer/Desktop/net.txt                                                                                                                 
Downloaded 235b in 7 seconds

This is a very interesting trick indeed. Allowing you to download a file without using a GUI.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.