Hello. There are 2 computers. 192.168.1.1 and 192.168.1.2. I’ve connected them. They ping each other. But I can’t mount folder from one to another.
That’s what I do:
mount -t cifs //192.168.1.2/home /mnt/test
Password:
mount error 111 = Connection refused
The problem is that where can I find the password??? I’ve tried root password and some else. I’ve tried without password, but the same result. There is no servers and clients. Just 2 PCs.
Please, help!
I assume //192.168.1.2 is a Linux machine? A coupe of questions:
Did you consciously adjust that machine’s Samba configurationto share the directory /home? As far as I know, openSUSE defaults don’t serve up a share on /IPaddress/home, so you must have set that up yourself, is that right?
The password for a share that requires no authentication is a null (carriage return). The credentials for a share that requires authentication are set on 192.168.1.2 in tha Samba User database using the command “sudo smbpasswd -a username”.
SergJ4 wrote:
> Hello. There are 2 computers. 192.168.1.1 and 192.168.1.2. I’ve
> connected them. They ping each other. But I can’t mount folder from one
> to another.
> That’s what I do:
>
> mount -t cifs //192.168.1.2/home /mnt/test
> Password:
> mount error 111 = Connection refused
That should tell you there’s nothing (no service) to connect to.
> The problem is that where can I find the password??? I’ve tried root
That’s not the problem.
> password and some else. I’ve tried without password, but the same
> result. There is no servers and clients. Just 2 PCs.
That’s the problem.
To use CiFS from one Linux PC to another, one has to take the role of server.
With e.g. XP Prof there is always a SMB service, so you can simply mount
a Windows drive (if it’s shared of course).
Set-up A Samba server on one of the PCs, or use another sort of service. like
SSH/sFTP that is more readily available on Linux PCs.
If the result is empty so your samba server isn’t running (correctly). First make sure with Yast that the samba server is installed. Install it if not.
Then go to Yast “Network Services” and look for the samba server configuration. Also you have to add with smbpasswd a user for the samba server. As root you have to type in a console:
smbpasswd -a username
You will be promted twice for a password. After that you can try this:
mount -t cifs -o user=username,password=password //192.168.1.2/home /mnt/test
The username and password must be that one you created with smbpasswd. You can also use the share with any other program like konqueror typing as address smb://192.168.1.2/home. You will be promted for username and password.
>
> Hello. There are 2 computers. 192.168.1.1 and 192.168.1.2. I’ve
> connected them. They ping each other. But I can’t mount folder from one
> to another.
> That’s what I do:
>
> mount -t cifs //192.168.1.2/home /mnt/test
> Password:
> mount error 111 = Connection refused
>
> The problem is that where can I find the password??? I’ve tried root
> password and some else. I’ve tried without password, but the same
> result. There is no servers and clients. Just 2 PCs.
> Please, help!
>
>
is Samba actually running on 192.168.1.2? In a console on 192.168.9.2 …
(as root)
rcsmb status
are there any shares at all?
% smbclient -L localhost
are there any shares visible to a user
% smbclient -L localhost -U name_of_a_user
can you see the Samba server from 192.168.9.1? In a console on
192.168.9.1 …
% smbclient -L 192.168.1.2
are there any shares visible to a user
% smbclient -L 192.168.1.2 -U name_of_a_user
In console of 192.168.1.1:
smbclient -L 192.168.1.2
Enter root’s password:
Domain=[HOME] OS=[Unix] Server=[Samba 3.2.4-4.3-2042-SUSE-SL11.0]
Sharename Type Comment
--------- ---- -------
profiles Disk Network Profiles Service
users Disk All users
groups Disk All groups
print$ Disk Printer Drivers
netlogon Disk Network Logon Service
IPC$ IPC IPC Service (Samba 3.2.4-4.3-2042-SUSE-SL11.0)
Server Comment
--------- -------
COMP2 Samba 3.2.4-4.3-2042-SUSE-SL11.0
Workgroup Master
--------- -------
HOME COMP2
Why can’t I add new user to server database? When I type smbclient -L localhost in console of 192.168.1.2 the result is the same as smbclient -L 192.168.1.2 in console of 192.168.1.1.
And now, when I’m trying to mount something:
mount -a //192.168.1.2/home /mnt/test -o user=user_name,password=user_password
mount error 6 = No such device or address
I use root password for Samba server as user_password
>
> Well, I’ve configured Samba server on 192.168.1.2, so it’s running now:
>
> In console of 192.168.1.2:
> rcsmb status
> Checking for Samba SMB daemon
> running
>
> smbpasswd -a comp1
> New SMB password:
> Retype new SMB password:
> Failed to modify password entry for user comp1
% man smbpasswd
<snip>
This option is only available when running smbpasswd as root
</snip>
>
> netstat -apn | grep “LISTEN” | grep smb
> tcp 0 0 0.0.0.0:139
> 0.0.0.0:* LISTEN 4791/smbd
> tcp 0 0 0.0.0.0:139
> 0.0.0.0:* LISTEN 4791/smbd
>
>
> In console of 192.168.1.1:
> smbclient -L 192.168.1.2
> Enter root’s password:
> Domain=[HOME] OS=[Unix] Server=[Samba 3.2.4-4.3-2042-SUSE-SL11.0]
>
> Sharename Type Comment
> --------- ---- -------
> profiles Disk Network Profiles Service
> users Disk All users
> groups Disk All groups
> print$ Disk Printer Drivers
> netlogon Disk Network Logon Service
> IPC$ IPC IPC Service (Samba
> 3.2.4-4.3-2042-SUSE-SL11.0)
> Domain=[HOME] OS=[Unix] Server=[Samba 3.2.4-4.3-2042-SUSE-SL11.0]
>
> Server Comment
> --------- -------
> COMP2 Samba 3.2.4-4.3-2042-SUSE-SL11.0
>
> Workgroup Master
> --------- -------
> HOME COMP2
>
>
>
> Why can’t I add new user to server database? When I type smbclient -L
> localhost in console of 192.168.1.2 the result is the same as smbclient
> -L 192.168.1.2 in console of 192.168.1.1.
> And now, when I’m trying to mount something:
>
> mount -a //192.168.1.2/home /mnt/test -o
> user=user_name,password=user_password
> mount error 6 = No such device or address
>
> I use root password for Samba server as user_password
>
>
It’s worth running …
% smbclient -L 192.168.1.2 -U user_name
and giving the user’s password as this’ll show the actual shares for that
user.
As swerdna points out the [home] section is a special in smb.conf where
[home] gets replaced with the user’s id so - in your situation, if you have
a user called fred
% mbclient -L 192.168.1.2 -U fred
should give something like (after you enter fred’s password)
Sharename Type Comment
profiles Disk Network Profiles Service
users Disk All users
groups Disk All groups
print$ Disk Printer Drivers
netlogon Disk Network Logon Service
IPC$ IPC IPC Service (Samba 3.2.4-4.3-2042-SUSE-SL11.0)
fred Disk Personal documents for user: fred
Domain=[HOME] OS=[Unix] Server=[Samba 3.2.4-4.3-2042-SUSE-SL11.0]
Server Comment
COMP2 Samba 3.2.4-4.3-2042-SUSE-SL11.0
Workgroup Master
HOME COMP2
As always with these things its best to start off from the simplest
situation and then build up - get the service running, check it works on
the host box, check that user authentication works, try a simple remote
connection …
you may find it useful to run a kwatch or tail -f
on /var/log/samba/log.smb while trying things out to see what messages come
up.
Sharename Type Comment
--------- ---- -------
users Disk All users
netlogon Disk Network Logon Service
IPC$ IPC IPC Service (Samba 3.2.4-4.3-2042-SUSE-SL11.0)
Server Comment
--------- -------
COMP2 Samba 3.2.4-4.3-2042-SUSE-SL11.0
Workgroup Master
--------- -------
HOME COMP2
mount -t cifs -o username=Serg,password=123 //192.168.1.2/users /mnt/test
mount error 13 = Permission denied
I’ve changed owner and rights for all to /mnt/test, so it is:
Comp1:/mnt # ls -l
total 4
drwxrwxrwx 2 root root 4096 Jan 11 19:16 test
The same result. Permission denied. I found nothing useful in samba’s log files. There just written when it was started and that Server’s role not advised with domain-level security.
The mount command
mount -t cifs -o username=Serg,password=123 //192.168.1.2/users /mnt/test
looks correct
The error: mount error 13 = Permission denied
will occurr if the credentials (Serg+123) are not correct for the server.
The credentials you use in the mount command are the username and password on the server; i.e. 192.168.1.2. If you added Serg to the Samba user database on the client, that’s the wrong database. You must add Serg to the Samba user database on the server.
I’ve added this user and password exact on the server. I changed password for this user several times and no result. I tried to create this user without password. No result. Permission denied. I tried to mount it as smbfs, but OpenSuse does not support it.
>
> I’ve created user Serg and password for him. That what is happening now
> (console of 192.168.1.1):
>
> smbclient -L 192.168.1.2 -U Serg
> Enter Serg’s password:
> Domain=[HOME] OS=[Unix] Server=[Samba 3.2.4-4.3-2042-SUSE-SL11.0]
>
> Sharename Type Comment
> --------- ---- -------
> users Disk All users
> netlogon Disk Network Logon Service
> IPC$ IPC IPC Service (Samba
> 3.2.4-4.3-2042-SUSE-SL11.0)
> Domain=[HOME] OS=[Unix] Server=[Samba 3.2.4-4.3-2042-SUSE-SL11.0]
>
> Server Comment
> --------- -------
> COMP2 Samba 3.2.4-4.3-2042-SUSE-SL11.0
>
> Workgroup Master
> --------- -------
> HOME COMP2
<snip>
The only share available here is users.
Try mounting users - at least that exists. If that works then there’s a
problem with the [homes] configuration.
If [homes] is set up correctly then you should see a Sharename of Serg -
until it shows up you won’t be able to mount it
While debugging set up a watch for /var/log/samba/log.smb - this will show
you what’s happening when samba tries to authenticate Serg.
Rather than work across 2 machines work on the one machine (192.168.9.2)
until you can see a share for Serg, then get the mount to work on the local
machine. Then, when that works, try remote mount on another machine.
Yes, I did. Permission denied. Even if I try to do it only on Comp2 (Server - 192.168.1.2).
I’ve enabled Sharename “homes”, but when I try to mount with this sharename:
mount -t cifs -o username=Serg,password=1 //192.168.1.2/homes /mnt/test
Mount Error 6 = No such device or address
>
> erikro;1926671 Wrote:
>> Hi,
>>
>> did you try the mount as I told you:
>>
>> >
> Code:
> --------------------
> > >
> > mount -t cifs -o username=COMP2/Serg,password=123 //COMP2/users
> > /mnt/test
> >
> --------------------
>> >
>>
>> bye
>>
>> Erik
> Yes, I did. Permission denied. Even if I try to do it only on Comp2
> (Server - 192.168.1.2).
> I’ve enabled Sharename “homes”, but when I try to mount with this
> sharename:
>
> mount -t cifs -o username=Serg,password=1 //192.168.1.2/homes
> /mnt/test
> Mount Error 6 = No such device or address
>
Serg4J;
[homes] is a special share, the actual file shared is //<server>/<username>
where <username> is the Linux user that authenticates on the Samba server.
> If:
> mount -t cifs -o username=Serg,password=1 //192.168.1.2/users
> /mnt/test
>
> Then:
> Mount Error 13 = Permission denied.
>
<snip>
Serg4J;
Did you execute the mount as root?
It might help a lot if we could see the contents of /etc/samba/smb.conf. If
there is sensitive information (e.g. public IPs) in the smb.conf you can use
dummy values when posting.
P. V.
“We’re all in this together, I’m pulling for you.” Red Green
Did you execute the mount as root?
It might help a lot if we could see the contents of /etc/samba/smb.conf. If
there is sensitive information (e.g. public IPs) in the smb.conf you can use
dummy values when posting.
Yes, as root. on both PCs. Here is my smb.conf:
smb.conf is the main Samba configuration file. You find a full commented
version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the
samba-doc package is installed.
Date: 2009-01-08
[global]
workgroup = HOME
printing = cups
printcap name = cups
printcap cache time = 750
cups options = raw
map to guest = Bad User
include = /etc/samba/dhcp.conf
logon path = \%L\profiles.msprofile
logon home = \%L%U.9xprofile
logon drive = P:
usershare allow guests = No
add machine script = /usr/sbin/useradd -c Machine -d /var/lib/nobody -s /bin/false %m$
domain logons = Yes
domain master = Yes
passdb backend = smbpasswd:password
security = user
local master = Yes
os level = 65
preferred master = Yes
idmap gid = 1000-20000
idmap uid = 1000-20000
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes
Share disabled by YaST
[profiles]
comment = Network Profiles Service
path = %H
read only = No
store dos attributes = Yes
create mask = 0600
directory mask = 0700
[users]
comment = All users
path = /home
read only = No
inherit acls = Yes
veto files = /aquota.user/groups/shares/
Share disabled by YaST
[groups]
comment = All groups
path = /home/groups
read only = No
inherit acls = Yes
Share disabled by YaST
[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No
Share disabled by YaST
[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @ntadmin root
force group = ntadmin
create mask = 0664
directory mask = 0775
[netlogon]
comment = Network Logon Service
path = /var/lib/samba/netlogon
write list = root
>
>>
>> Did you execute the mount as root?
>> It might help a lot if we could see the contents of
>> /etc/samba/smb.conf. If
>> there is sensitive information (e.g. public IPs) in the smb.conf you
>> can use
>> dummy values when posting.
>>
>
> Yes, as root. on both PCs. Here is my smb.conf:
> # smb.conf is the main Samba configuration file. You find a full
> commented
> # version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if
> the
> # samba-doc package is installed.
> # Date: 2009-01-08
> [global]
> workgroup = HOME
> printing = cups
> printcap name = cups
> printcap cache time = 750
> cups options = raw
> map to guest = Bad User
> include = /etc/samba/dhcp.conf
> logon path = \%L\profiles.msprofile
> logon home = \%L%U.9xprofile
> logon drive = P:
> usershare allow guests = No
> add machine script = /usr/sbin/useradd -c Machine -d /var/lib/nobody
> -s /bin/false %m$
> domain logons = Yes
> domain master = Yes
> passdb backend = smbpasswd:password
> security = user
> local master = Yes
> os level = 65
> preferred master = Yes
> idmap gid = 1000-20000
> idmap uid = 1000-20000
>
>
> [homes]
> comment = Home Directories
> valid users = %S, %D%w%S
> browseable = No
> read only = No
> inherit acls = Yes
>
> ## Share disabled by YaST
> # [profiles]
> #comment = Network Profiles Service
> #path = %H
> #read only = No
> #store dos attributes = Yes
> #create mask = 0600
> #directory mask = 0700
>
> [users]
> comment = All users
> path = /home
> read only = No
> inherit acls = Yes
> veto files = /aquota.user/groups/shares/
>
> ## Share disabled by YaST
> # [groups]
> #comment = All groups
> #path = /home/groups
> #read only = No
> #inherit acls = Yes
>
> ## Share disabled by YaST
> # [printers]
> #comment = All Printers
> #path = /var/tmp
> #printable = Yes
> #create mask = 0600
> #browseable = No
>
> ## Share disabled by YaST
> # [print$]
> #comment = Printer Drivers
> #path = /var/lib/samba/drivers
> #write list = @ntadmin root
> #force group = ntadmin
> #create mask = 0664
> #directory mask = 0775
>
> [netlogon]
> comment = Network Logon Service
> path = /var/lib/samba/netlogon
> write list = root
>
> I’ve disabled some shares in YaSt.
>
>
SergJ4;
You only have two computers. Is this correct? Are they both running
Linux?
Until you answer (1) I’m not sure this applies, but this is what I see.
A)You have set up Samba as a PDC (Primary domain controller), this seems
like overkill for just two computers and unnecessarily increases
complexity of connecting the two.
B)If Samba is configured the same on both, you have two(2)PDCs on the same
domain. This NEVER works.
C) I suggest you scrap this, and configure Samba as shown on Swerdna’s
site: http://www.swerdna.net.au/linhowtosimpleshares.html
D) Read all the relevant HowTo’s on this page: http://www.swerdna.net.au/linux.html
If you really intended to setup a PDC, or need additional help please post
back. If you change your smb.conf, be sure to post the new configuration.
–
P. V.
“We’re all in this together, I’m pulling for you.” Red Green
Great Thanks to all!!!rotfl! IT WORKS!!! I’ve changed smb.conf exact as it written here: Samba Server and Suse: HowTo Configure Shares on an openSUSE File Server on a SOHO LAN
And it works. Here is smb.conf (I’ve just commented some strings that were unnecessary):
workgroup = HOME
printing = cups
printcap name = cups
printcap cache time = 750
cups options = raw
map to guest = Bad User
include = /etc/samba/dhcp.conf
logon path = \%L\profiles.msprofile
logon home = \%L%U.9xprofile
logon drive = P:
usershare allow guests = No