Browsing and Downloading Shared Files and Folders with Samba in Terminal.
Monday, April 28, 2008 2:52:18 AM
I'm using ssh to connect to my ubuntu server with no GUI and I need to access some files that are shared on another computer that is local to the computer I'm logging into.
As in:
Me <--- Internet ---> (Ubuntu Server) <--> (Computer with files on it)
(Assuming you know the host name of the computer want to access) To get a listing of all the shared folders on the host type:
smbclient -L //hostname
You should then get an output of shared folders on that computer you can change directly into the shared folder you want to go into via this command:
smbclient //server/sharename
All the usual commands should work such as ls and cd.
To download files use the commands get (single file) and mget (multiple files).
If a username is required you can change the default user by adding "-U" to the end, for example:
smbclient //server/sharename -U user1
Notes:
Samba seams to ask for a password everytime you try to login to another computers shared folders, even if the share has no password, simply hitting enter will allow you to login to the share.
Where you currently are on the computer (is terms of directory structure) is where the files will try to download to, For example if you are in /home/yourname when you use smbclient, by default files will download to /home/yourname
If you are trying to download/copy files into a protected area, use sudo smbclient.
References:
http://www.lockergnome.com/linux/2002/01/10/samba-client/
As in:
Me <--- Internet ---> (Ubuntu Server) <--> (Computer with files on it)
(Assuming you know the host name of the computer want to access) To get a listing of all the shared folders on the host type:
smbclient -L //hostname
You should then get an output of shared folders on that computer you can change directly into the shared folder you want to go into via this command:
smbclient //server/sharename
All the usual commands should work such as ls and cd.
To download files use the commands get (single file) and mget (multiple files).
If a username is required you can change the default user by adding "-U" to the end, for example:
smbclient //server/sharename -U user1
Notes:
Samba seams to ask for a password everytime you try to login to another computers shared folders, even if the share has no password, simply hitting enter will allow you to login to the share.
Where you currently are on the computer (is terms of directory structure) is where the files will try to download to, For example if you are in /home/yourname when you use smbclient, by default files will download to /home/yourname
If you are trying to download/copy files into a protected area, use sudo smbclient.
References:
http://www.lockergnome.com/linux/2002/01/10/samba-client/







