Cannot mount Windows 98 SE share over SSH to Ubuntu 14.04
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?
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.
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 nameAUTOSAVES
name of shared folderMOSSBAERLAB
is a Workgroup name
There are one significant thing that should be Noted, all names (Computer, Workgroup, Share) must be in uppercase.