Linux - NewbieThis 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.
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.
I've been struggling with this samba server to no avail. I have a centos 6.6 system. The configuration file is really basic (just want to make sure it works outside):
Quote:
[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = name
security = user
map to guest = bad user
dns proxy = no
[allaccess]
path = /samba/allaccess
browsable = yes
writable = yes
guest ok = yes
read only = no
$ smbclient -L localhost displays "allaccess" as a shared folder.
$ smbclient \\\\localhost\\allaccess also works. I've managed to edit it through the samba client.
I have also tested that the /etc/samba/smb.conf is the configuration file samba is working with.
I have disabled iptables altogether to test it.
$ netstat -tulpn | egrep "smb|nmb" displays the following (public ip is of course not shown and is changed to 192.168.1.0/24):
I've tried connecting through mac (finder - go - connect to server): smb://192.168.1.1 (with or without /allaccess)
And I've also tried it through windows 7 (on a virtual machine, of course with working internet connection). Run and then: \\192.168.1.1 with or without \allaccess (but also through \\name, consistent with the net bios directive and after changing it accordingly in windows's hosts)
I only have a headless install of centos and I can't (off hand) think of how to "ssh -x" to the security settings. But, I am sure there is a setting which opens up samba. My notes on setting up samba include:
By disable iptables I simply mean $ service iptables stop.
Yes, both nmb and smb are on (it it shown in the netstat output)
This is the output of the testparm command:
Quote:
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[allaccess]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Ah, and I forgot to write it in the first post. As the tutorial that I've read instructed, I've also run the command: $ chcon -t samba_share_t /samba/allaccess/ (as you've reminded me of selinux)
I must admit that I'm impressed by the huge support I've received on this forum. Whenever I encounter problems at least I know I'll get the necessary help here.
You wouldn't believe the number of times permissions has been the culplrit of samba setups.
Are you sure access is permitted?
This means that /samba/allaccess must have permissions accessible to the samba user but
/samba/ must also permit access, at least execute & read for the directory
You wouldn't believe the number of times permissions has been the culplrit of samba setups.
Are you sure access is permitted?
This means that /samba/allaccess must have permissions accessible to the samba user but
/samba/ must also permit access, at least execute & read for the directory
These are the current permissions to the directory according to a tutorial I've read on the internet (I can't remember the link to it). So others have read and execute permissions. As I've said in the first post, the idea is to simply test if the samba server works, so there shouldn't be any user restrictions.
Quote:
drwxr-xr-x. 3 nobody nobody 4096 Dec 28 04:15 /samba/allaccess/
/samba directory also has read and execute permissions for others.
The thing is, when I try to connect from mac os (finder - go - connect to server - smb://192.168.1.1/allaccess) it simply says that "the server may not exist or it is unavailable at this time. Check the server name or IP address, your network connection, etc.)" Shouldn't the error be more explicit than that if there were any permission problems?
As I've already said, I've disable iptables just to make sure (through service iptables stop).
If it makes any difference, I should also say that when I connect to samba locally it asks for my user's password, which I can skip by simply pressing enter (by smbclient \\\\localhost\\allaccess or by smbclient -L localhost -> in order to see what folders are shared).
Oh, and that the user on Mac OS does not have a corresponding user on Cent OS (although the Windows VM through which I tried to connect did)
Only now did it occur to me to mention that the server and the client are not on the same network. So I'm trying to connect remotely. I've read that samba doesn't allow remote connections natively, right? I'm really not sure about what I'm doing. And if samba doesn't work, what other options are there? (for both Windows and Mac OS)
We will need additional information as to what you mean by remotely and what you are trying to accomplish.
You can use a sftp client like filezilla with windows as OS X to transfer files between computers. The details will depend on the above and your network configuration.
I mean to say that they're not on the same LAN (the server and the client - the connection between the two goes through the internet).
The initial idea was to set up the most basic samba server in order to access data (files) on the server. Now that I realise that is not recommended (security, performance, etc.) and a little more complicated to do with samba if the server and the client are on different networks (so NOT on the same LAN), I am trying to find out about some other viable options. I know about filezilla, but I thought maybe I can set up something that looks more native. For instance, browsing and editing the data on the server with explorer or finder, respectively.
Perhaps try public key based ssh? (edit: Actually, scratch that. ssh is amazing in a linux only enviroment, secure cli usage, gui usage, whatever. But I don't believe windows putty supports navigating through explorer - although you could use a form of scp to copy files to and from.)
Quote:
smb://192.168.1.1/allaccess
This is specified to a LAN address. If the samba server is at 192.168.1.1 and your client at another location (not under same network) goes to 192.168.1.1, this is not the same place.
However, if under the same network, you go to 192.168.1.1 I suspect you would find it.
If I go to 192.168.1.1, I don't expect to find your samba server there!
___
Think of internal & external like this:
I am in my house. My postal address is 123 and go to room 1, then room 2.
Then I go to your house at postal address 654 and go to room 1, then room 2.
Are these rooms in the same place?
If I were to describe to someone my location and I said, "I am in room 2", would you know where I am?
Perhaps try public key based ssh? (edit: Actually, scratch that. ssh is amazing in a linux only enviroment, secure cli usage, gui usage, whatever. But I don't believe windows putty supports navigating through explorer - although you could use a form of scp to copy files to and from.)
This is specified to a LAN address. If the samba server is at 192.168.1.1 and your client at another location (not under same network) goes to 192.168.1.1, this is not the same place.
However, if under the same network, you go to 192.168.1.1 I suspect you would find it.
If I go to 192.168.1.1, I don't expect to find your samba server there!
___
Think of internal & external like this:
I am in my house. My postal address is 123 and go to room 1, then room 2.
Then I go to your house at postal address 654 and go to room 1, then room 2.
Are these rooms in the same place?
If I were to describe to someone my location and I said, "I am in room 2", would you know where I am?
I know the difference between private and public IPs. I can't explain each and every time I post something on the subject that I've changed the public ip to a private one (it would have been silly, I think, to write a random public ip). I've already said it in the first post. So, yes, we're talking about and a server on completely different networks.
With osx you can use the sshfs fuse file system to mount a directory. Still uses sftp to but you get that native look. With windows the only way to get the native look is using a vpn.
Another idea would be go set up your own cloud with owncloud.
Did you add your windows user in smbpasswd? Make sure file & printer sharing is enabled in your windows machine firewall, and that your windows machine is in the same workgroup as your linux samba server.
If all you need is manual file access from windows, winSCP works over ssh and provides an explorer-like interface.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.