1

I am in a SSH session to Ubuntu 14.04 and I am trying to mount a Windows 98SE share using the following command:

sudo mount -t cifs //192.168.0.2/uniserv /tmp/uniserv/ -o sec=lanman,servern=Uniplus1

In response Ubuntu asks me for a root password for the share:

Password for root@//192.168.0.2/uniserv:

Why is the share not mounting and why am I being asked for a root password?

Eliah Kagan
  • 117,780
Hendré
  • 759

2 Answers2

2

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 bashism (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.

Eliah Kagan
  • 117,780
  • @Hendre Which command is giving that? – Eliah Kagan Aug 28 '14 at 20:33
  • here is the complete command I am using:

    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

    1. I can ping the host, however the command waits for a response indefinitely?

    2. sudo smbtree lists the host but not the uniserv share.

    3. I can access the share from Nautilus

    – Hendré Aug 28 '14 at 21:01
0

I solved an issue how to connect old Windows 98 to Ubuntu/Debian using mount.cifs (in my case my system is Raspbian), working command is:

sudo mount -t cifs -o user=guest,pass=,vers=1.0,sec=none,domain=MOSSBAUERLAB,ip=192.168.10.217,servern=MICHAEL //MICHAEL/AUTOSAVES /mnt/sm2201/dev

Where:

  • MICHAEL is my computer name
  • AUTOSAVES name of shared folder
  • MOSSBAERLAB is a Workgroup name

There are one significant thing that should be Noted, all names (Computer, Workgroup, Share) must be in uppercase.