Samba: smbclient
Connecting to a remote PC is something a must in passing or transfering files. An o/s platform other than Windows, for example, UNIX and Linux, need a protocol to connect to windows. The word samba comes in place for such doings. Samba uses the TCP/IP protocol that is installed and correctly configured, it allows that host to interact with a Microsoft Windows client or server as if it is a Windows file and print server.
Here is few methods to be achieve on making a samba connection.
Here is samba connection with smbclient. A ftp way of remote shared folders.
The option L tells the samba to just list what is shared and U for user. As you can see, windows has this one thing that I dislike. An open shared for each partition. Easy for people to penetrate using brute force. Next, after viewing the clients share files. Let us connect to it. Here is the next command.
This is my output from terminal.
Here you can get put files as you wish. To get files use command get. While to put use put. Let me view the directory first by using command dir.
Do as below.
Mod it and put it back. Here put is use.
recurse - all the inside directory
prompt - no need to type y everytime.
mget - get all
To put do the same but use mput. Oh. If you can't use smbclient try download from know repos using yum install samba-client samba samba-common.
If you want to easily connect with gui just do as below. Type in smb://<no. ip>
Here is few methods to be achieve on making a samba connection.
Here is samba connection with smbclient. A ftp way of remote shared folders.
smbclient -L <ip no> -U username -pwd passwordThis will show the ip address info via samba. I got something like this.
[root@localhost ahmyi]# smbclient -L 10.5.10.200 -U AdministratorEnter Administrator's password:Domain=[LNA] OS=[Windows 7 Ultimate 7600] Server=[Windows 7 Ultimate 6.1]Sharename Type Comment
--------- ---- -------
IPC$ IPC Remote IPC
print$ Disk Printer Drivers
downloads Disk
LJ3005 Printer LJ3005
ADMIN$ Disk Remote Admin
C$ Disk Default share
Server Comment
--------- -------
Workgroup Master
--------- -------
The option L tells the samba to just list what is shared and U for user. As you can see, windows has this one thing that I dislike. An open shared for each partition. Easy for people to penetrate using brute force. Next, after viewing the clients share files. Let us connect to it. Here is the next command.
smbclient \\\\<ip address>\\<folder> -U usernameThe \ doubles up if you notice. Normally we would just do \\<ip address>\<folder>
This is my output from terminal.
[root@localhost ahmyi]# smbclient \\\\10.5.10.200\\c$ -U AdministratorEnter Administrator's password:Domain=[LNA] OS=[Windows 7 Ultimate 7600] Server=[Windows 7 Ultimate 6.1]smb: \>
Here you can get put files as you wish. To get files use command get. While to put use put. Let me view the directory first by using command dir.
smb: \> dir
. D 0 Mon Apr 26 16:37:26 2010
.. D 0 Mon Apr 26 16:37:26 2010
.DS_Store AHSR 15364 Sun Feb 21 14:44:04 2010
AUTOEXEC.BAT AHSR 0 Mon Apr 26 20:21:48 2010
boot.ini AHSR 211 Mon Apr 26 15:44:51 2010
CONFIG.SYS AHSR 0 Mon Apr 26 20:21:48 2010
userdata D 0 Mon Apr 26 16:40:44 2010Lets copy boot.ini and copy the folder userdata. First of all create a folder on your home. I created samba. This is where I will transfer all the files into.
xampp D 0 Mon Apr 26 16:40:46 2010
38103 blocks of size 2097152. 11404 blocks available
smb: \>
Do as below.
smb: \> lcd sambaSo now in your home/samba folder exists the file you just get. Next lets do some modification towards the file and put it back. Here is what's inside the boot.ini file.
smb: \> get boot.ini
getting file \boot.ini of size 211 as boot.ini (103.0 KiloBytes/sec) (average 103.0 KiloBytes/sec)
smb: \>
Mod it and put it back. Here put is use.
smb: \> put boot.iniNow copying the whole folder userdata.
putting file boot.ini as \boot.ini (103.0 kb/s) (average 103.0 kb/s)
smb: \>
smb: \> tarmodeHere is the explaination.
tarmode is now full, system, hidden, noreset, verbose
smb: \> recurse
smb: \> prompt
smb: \> mget userdata
getting file \userdata\user1.dat of size 820 as user1.dat (61.6 KiloBytes/sec) (average 61.6 KiloBytes/sec)
getting file \userdata\userdata.exe of size 25145632 as userdata.exe (11405.6 KiloBytes/sec) (average 11337.5 KiloBytes/sec)
getting file \userdata\users.dat of size 20 as users.dat (19.5 KiloBytes/sec) (average 11332.3 KiloBytes/sec)
smb: \>
recurse - all the inside directory
prompt - no need to type y everytime.
mget - get all
To put do the same but use mput. Oh. If you can't use smbclient try download from know repos using yum install samba-client samba samba-common.
If you want to easily connect with gui just do as below. Type in smb://<no. ip>
Comments
Post a Comment