Nope. Your server won't understand the credentials from your local PC because the SIDs would be completely different even if you have the same name on both servers.
If you're looking to have a central file space, you can just map the share as a network drive and the auto-login capabilities will take care of your requirement.
Answer from Nathan C on Stack ExchangeVideos
To be thorough:
First, create a samba user if you haven't already:
useradd sambauser
smbpasswd -a sambauser
Enter and confirm the password for sambauser.
Change that part of your /etc/samba/smb.conf to this:
[share]
comment = Ubuntu File Server Share
path = /srv/samba/share
valid users = sambauser
browsable = yes
writable = yes
write list = sambauser
create mask = 0755
Make sure that the directory and everything that might be inside has the proper ownership and permissions:
chown -R sambauser:sambauser /srv/samba/share
chmod -R 755 /srv/samba/share
Make sure that you have allowed samba through selinux with this command if it is enabled. If selinux is not enabled then you can skip this part:
chcon -R -t samba_share_t /srv/samba/share
Lastly, make sure that the ports are open for samba on the firewall.
firewall-cmd --permanent --zone=public --add-port=445/tcp
firewall-cmd --permanent --zone=public --add-port=139/tcp
firewall-cmd --reload
systemctl restart firewalld
If using `iptables:
iptables -A INPUT -p tcp --dport 445 -j ACCEPT
iptables -A INPUT -p tcp --dport 139 -j ACCEPT
iptables-save
iptables-restore
Restart the samba service and then log in with the credentials of sambauser.
Turn off guest permissions and log into the shared drive with the owners credentials from the SAMBA machine to which owns the folder.
I assume that you have a central windows server with central user profiles (active directory). To integrate these workstations you have to mount the user home directories into /home on your linux machines and hook up the active directory into linux.
The keywords that you want to search for are: ldap pam active directory integration. Useful links:
- Ubuntu Active Directory Howto
- Debian LDAP/PAM
note that integrating a windows machine into linux/ldap is generally not recommended (unless you have lots and lots of spare time on your hands). It might work satisfactorily with Samba 4.0. I haven't tried since it provides its own ldap...
Edit: I think I might have misunderstood you. If you want to access a linux samba share from windows simply follow the Ubuntu Samba Server Guide. If you want to login with as $user to the server simply create $user on the server. And set a samba password for the user:
smbpasswd -a $user
the configure the samba server according to your needs. Note: You don't need ldap/kerberos for this kind of setup. It usually helps to use your windows username and password as username/password for the linux user $user. In that case you won't need to configure any passwords on Windows.
I haven't actually tried this but I might need it myself soon. Maybe this link could help you? For future reference I'll copy the proposed solution here as well.
Add a line in /etc/samba/smbusers of the form:
linux_name = windows_name1 windows_name2 <etc.>
e.g.
a_user = [email protected]
This maps Windows name(s) (i.e. your Microsoft account used to log on to Windows 8) to a linux name (i.e. an existing linux & samba account). You may also need to add this parameter to the [global] section of: /etc/samba/smb.conf.
username map = /etc/samba/smbusers
To test the configuration use the following command:
testparm -vs | grep "username map"
Let me know if you got it to work!
I recommend to create a dedicated user for that share and specify it in force user(see docs).
Create a user (shareuser for example) and set the owner of everything in the share folder to that user:
adduser --system shareuser
chown -R shareuser /path/to/share
Then add force user and permission mask settings in smb.conf:
[myshare]
path = /path/to/share
writeable = yes
browseable = yes
public = yes
create mask = 0644
directory mask = 0755
force user = shareuser
Note that guest ok is a synonym for public.
In the share settings in smb.conf, you'll need to specify the names of users and/or groups that are allowed to write to the share, using a write list = ... line.
Example:
[myshare]
...
write list = my_linux_username
Then you'll need to use the smbpasswd command to set up a password to authenticate my_linux_username for Samba:
sudo smbpasswd -a my_linux_username
This step is necessary because the standard system passwords in /etc/shadow are hashed in algorithms that are incompatible with the password hash algorithms used in the SMB protocol. When a client sends a SMB authentication packet, it includes a hashed password. It can only be compared to another password hash that uses the same algorithm.
(Very, very old instructions from the previous millennium may recommend disabling password encryption in Samba, and using certain registry hacks to allow Windows to emit unencrypted passwords to the network. This advice is obsolete: those registry hacks may no longer work in current versions of Windows, and allow anyone who can monitor your network traffic to trivially capture your password.)
There's one more thing you may have to do client-side. When your Windows client system is joined to an Active Directory domain and you're logged in with an AD account, it automatically prefixes all unqualified usernames with the name of the AD domain of the user, i.e. you will be authenticating as AD_DOMAIN\your_username, not just your_username.
If you are logged in with a local account (or your client system is not joined to an AD domain), Windows may automatically prefix the username with the client hostname unless you specify another domain name.
To successfully log in to a stand-alone Samba server from a stand-alone Windows client, you may have to specify your username as SAMBA_SERVER_HOSTNAME\your_username.
Otherwise Samba will see the username as WINDOWS_CLIENT_HOSTNAME\your_username, conclude that it has no way to verify any users belonging to domain named WINDOWS_CLIENT_HOSTNAME, and will reject the login.
(Newer versions of Samba may have a built-in check for this specific situation, and they might allow you access nevertheless. But this is basically how SMB authentication works "under the hood", and if you need to deal with old versions of Samba, it might be useful still.)
You can override stored credentials for shares in Windows via the credential manager.


Under Windows Credentials:
- If the server in question has an entry, delete it.
- Select Add a Windows Credential.
- Enter the server (e.g. \\IP address\Share).
- Enter new desired credentials.
Navigating manually to \\IP address\Share, it will not use the old credentials any more.
if you just renamed you username you have to use the old username and no way to use new name for that
if you made an other user for your laptop you have to enter new users login in smb login window