You're running the mount
command as root and haven't specified a different username. You can add username=user
to the -o
list (where user
is the username on target machine):
sudo mount -t cifs //192.168.0.2/uniserv /tmp/uniserv/ -o username=user,sec=lanman,servern=Uniplus1
If you want to connect to the share as a guest, use guest
instead of username=user
in the -o
list:
sudo mount -t cifs //192.168.0.2/uniserv /tmp/uniserv/ -o guest,sec=lanman,servern=Uniplus1
If the server gives information about ownership and permissions, mount.cifs
will try to respect it. Otherwise, all files and directories in the share will be owned by root, and accessible only by root. If you don't want that, you can add use the uid
and or gid
arguments to specify user or group IDs. A common way is uid=$UID
. For example:
sudo mount -t cifs //192.168.0.2/uniserv /tmp/uniserv/ -o guest,uid=$UID,sec=lanman,servern=Uniplus1
The UID
environment variable is a bash
ism (also in zsh
), so if you're invoking this command from a shell that doesn't support it (such as dash
, which provides sh
in Ubuntu), use $(id -ru)
instead (or manually put in your actual user ID number from /etc/passwd
):
sudo mount -t cifs //192.168.0.2/uniserv /tmp/uniserv/ -o guest,uid=$(id -ru),sec=lanman,servern=Uniplus1
Source: Mainly man mount.cifs
.
If you'd prefer to perform the mount operation itself as a regular (non-root) user, How do I mount Samba share as non-root user may help.
sudo mount -t cifs //192.168.0.2/uniserv /mnt/uniplus/ -o credentials=/etc/rivsen/.uniplus1.credentials,uid=1000,gid=1000,sec=lanman,workgroup=SENTRA,servern=Uniplus1
I can ping the host, however the command waits for a response indefinitely?
sudo smbtree
lists the host but not the uniserv share.I can access the share from Nautilus