olistudent
IPPF-Urgestein
- Mitglied seit
- 19 Okt 2004
- Beiträge
- 14,787
- Punkte für Reaktionen
- 13
- Punkte
- 38
Ich würde eher auf ein Freetz oder pebcac Problem tippen. Was du auch immer mit technisch meinst...
Gruß
Oliver
Gruß
Oliver
root@192:/var/mod/root# cat /mod/etc/samba/smb.conf
### global
[global]
netbios name = FRITZ.BOX
workgroup = ARBEITSGRUPPE
server string = %h (Samba %v)
syslog = 1
syslog only = yes
encrypt passwords = true
passdb backend = smbpasswd
obey pam restrictions = yes
socket options = TCP_NODELAY
unix charset = ISO-8859-1
preferred master = yes
os level = 20
security = user
guest account = ftpuser
username map = /mod/etc/samba/users.map
### expert
socket options = TCP_NODELAY IPTOS_LOWDELAY
read raw = yes
write raw = yes
oplocks = yes
max xmit = 65535
dead time = 15
getwd cache = yes
log file = /var/media/ftp/uStor01/log/samba.log.%m
log level = 4
max log size = 1000
### default
### shares
[public]
comment = Freigabe fuer Gast
path = /var/media/ftp/uStor01/public
guest ok = yes
read only = no
write cache size = 65536
user = ftpuser
[homes]
comment = Home-Verzeichnisse
path = /var/media/ftp/uStor01/home
guest ok = no
read only = no
create mask = 0700
browseable = no
write cache size = 65536
user = ftpuser
### fin
root@192:/var/mod/root# cat /mod/etc/default.samba/samba_conf
#!/bin/sh
. /etc/default.samba/modlibsamba
echo "### global"
cat << EOF
[global]
netbios name = $SAMBA_NETBIOS_NAME
workgroup = $SAMBA_WORKGROUP
server string = $SAMBA_SERVER_STRING
syslog = 1
syslog only = yes
encrypt passwords = true
passdb backend = smbpasswd
obey pam restrictions = yes
socket options = TCP_NODELAY
unix charset = ISO-8859-1
preferred master = $SAMBA_MASTER
os level = $SAMBA_OS_LEVEL
security = share
guest account = $SAMBA_SYSTEMUSER
username map = /mod/etc/samba/users.map
EOF
if [ -n "$SAMBA_INTERFACES" ]; then
cat << EOF
interfaces = $SAMBA_INTERFACES
bind interfaces only = yes
EOF
fi
echo "### expert"
[ -r "/tmp/flash/samba/sharesx" ] && cat /tmp/flash/samba/sharesx
echo "### default"
if [ "$MODLIBSAMBA_ENABLED" == "yes" ]; then
for SHARE in /var/media/ftp/*; do
if [ -d "$SHARE" ]; then
SHORTNAME=$(basename "$SHARE" | sed s/-Partition-/-/)
[ "$SHORTNAME" == "lost+found" ] && continue
echo "[$SHORTNAME]"
echo " path = $SHARE"
echo " user = $SAMBA_SYSTEMUSER"
echo " read only = $MODLIBSAMBA_READONLY"
[ "$MODLIBSAMBA_PASSWORD" == "\"\"" ] && echo " guest ok = yes"
fi
done
fi
echo "### shares"
if [ -r "/tmp/flash/samba/shares" ]; then
cat /tmp/flash/samba/shares | grep -v "^#" | while read -r path name gk ro options comment; do
if [ -n "$path" -a -n "$name" -a -d "$path" ]; then
case $gk in
1|y|yes|Y|YES) gk="yes" ;;
0|n|no|N|NO|"") gk="no" ;;
esac
case $ro in
1|y|yes|Y|YES) ro="yes" ;;
0|n|no|N|NO|"") ro="no" ;;
esac
if [ "$options" != "-" ]; then
options=$(echo "$options" | sed -r -e 's,=, = ,g;s,(%20| )+, ,g;')
else
options=""
fi
echo "$options" | grep -q "user =" >/dev/null 2>&1 || options="$options,user = $SAMBA_SYSTEMUSER"
options=$(echo -e "${options//,/\\n }")
cat << EOF
[${name//%20/ }]
comment = $comment
path = $path
guest ok = $gk
read only = $ro
$options
EOF
fi
done
fi
echo "### fin"
echo "$options" | grep -q "user =" >/dev/null 2>&1 || options="$options,user = $SAMBA_SYSTEMUSER"
Wenn ich Pfade per "mount -o bind" in die Home-Verzeichnisse der User einbinde, erscheinen diese als Eintrag im "Eingehängte Partitionen"-Bereich auf der Status-Seite von Freetz. Das heißt, die externe Platte wird mehrfach aufgelistet. Gibt es eine Möglichkeit, das zu unterdrücken?Code:USERS="user1 user2" DIRS="shared public" for user in $USERS; do for dir in $DIRS; do mount -o bind /var/media/ftp/uStor01/$dir /var/media/ftp/uStor01/$user/$dir done done
Ausgabe sieht so aus:Was kommt bei Dir als Ausgabe von "cat /proc/mounts"?
rootfs / rootfs rw 0 0
/dev/root / squashfs ro 0 0
dev /dev tmpfs rw,nosuid 0 0
devpts /dev/pts devpts rw 0 0
proc /proc proc rw,nosuid,nodev,noexec 0 0
tmpfs /var tmpfs rw 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec 0 0
/dev/mtdblock5 /data jffs2 rw 0 0
usbfs /proc/bus/usb usbfs rw 0 0
/dev/sda1 /var/media/ftp/uStor01 fuseblk rw,user_id=0,group_id=0,allow_other 0 0
/dev/sda1 /var/media/ftp/uStor01/user2/docs fuseblk rw,user_id=0,group_id=0,allow_other 0 0
/dev/sda1 /var/media/ftp/uStor01/user2/images fuseblk rw,user_id=0,group_id=0,allow_other 0 0
/dev/sda1 /var/media/ftp/uStor01/user2/pictures fuseblk rw,user_id=0,group_id=0,allow_other 0 0
/dev/sda1 /var/media/ftp/uStor01/user2/music fuseblk rw,user_id=0,group_id=0,allow_other 0 0
/dev/sda1 /var/media/ftp/uStor01/user2/programs fuseblk rw,user_id=0,group_id=0,allow_other 0 0
/dev/sda1 /var/media/ftp/uStor01/user2/videos fuseblk rw,user_id=0,group_id=0,allow_other 0 0
/dev/sda1 /var/media/ftp/uStor01/user2/temp fuseblk rw,user_id=0,group_id=0,allow_other 0 0
/dev/sda1 /var/media/ftp/uStor01/user1/docs fuseblk rw,user_id=0,group_id=0,allow_other 0 0
/dev/sda1 /var/media/ftp/uStor01/user1/images fuseblk rw,user_id=0,group_id=0,allow_other 0 0
/dev/sda1 /var/media/ftp/uStor01/user1/pictures fuseblk rw,user_id=0,group_id=0,allow_other 0 0
/dev/sda1 /var/media/ftp/uStor01/user1/music fuseblk rw,user_id=0,group_id=0,allow_other 0 0
/dev/sda1 /var/media/ftp/uStor01/user1/programs fuseblk rw,user_id=0,group_id=0,allow_other 0 0
/dev/sda1 /var/media/ftp/uStor01/user1/videos fuseblk rw,user_id=0,group_id=0,allow_other 0 0
/dev/sda1 /var/media/ftp/uStor01/user1/temp fuseblk rw,user_id=0,group_id=0,allow_other 0 0
nfsd /proc/fs/nfsd nfsd rw 0 0
cat /var/tmp/flash/smbpasswd > /mod/etc/samba/smbpasswd
Index: make/samba/files/root/etc/init.d/rc.samba
===================================================================
--- make/samba/files/root/etc/init.d/rc.samba (Revision 9440)
+++ make/samba/files/root/etc/init.d/rc.samba (Arbeitskopie)
@@ -27,24 +27,24 @@
# encrypt password
local PASS_FILE=/mod/etc/samba/smbpasswd
- rm -rf $PASS_FILE 2>/dev/null
- if which smbpasswd >/dev/null; then
- if [ -n "$SAMBA_PASS" ]; then
- local CLEAR_FILE=/var/tmp/smbpasswd.cleartext
- local SAMBA_UID="$(id -u $SAMBA_SYSTEMUSER)"
- echo "$SAMBA_SYSTEMUSER:$SAMBA_UID:$SAMBA_PASS:[UX ]:LCT-00000001:" > $CLEAR_FILE
- smbpasswd 2>/dev/null
- rm $CLEAR_FILE
- # make sure a password is set
- if [ ! -r $PASS_FILE ]; then
- echo "can not encrypt password, failed."
- exit 1
- fi
- else
- # samba complains if the file does not exist
- touch $PASS_FILE
- fi
- fi
+# rm -rf $PASS_FILE 2>/dev/null
+# if which smbpasswd >/dev/null; then
+# if [ -n "$SAMBA_PASS" ]; then
+# local CLEAR_FILE=/var/tmp/smbpasswd.cleartext
+# local SAMBA_UID="$(id -u $SAMBA_SYSTEMUSER)"
+# echo "$SAMBA_SYSTEMUSER:$SAMBA_UID:$SAMBA_PASS:[UX ]:LCT-00000001:" > $CLEAR_FILE
+# smbpasswd 2>/dev/null
+# rm $CLEAR_FILE
+# # make sure a password is set
+# if [ ! -r $PASS_FILE ]; then
+# echo "can not encrypt password, failed."
+# exit 1
+# fi
+# else
+# # samba complains if the file does not exist
+# touch $PASS_FILE
+# fi
+# fi
return
}
Die Benutzer-IDs (1000, 1001, 1002) müssen wir uns merken. Sie werden mit den neue Samba-Passwörtern in eine Klartext-Datei eingetragen. (Die Datei wird in /var/tmp/ erstellt und überlebt so einen Reboot der Box nicht.)
/var/tmp/smbpasswd.cleartext....
Die neue Samba-Passwort-Datei wird in die Fritz!Box gespeichert.
Code:cp /mod/etc/samba/smbpasswd /var/tmp/flash modsave all
Unter der Vorraussetzung dass das ganze noch für aktuelle Revisionen gültig ist:Nun geht es zurück ins Freetz-WebIF
Einstellungen -> rc.custom
Code:cat /var/tmp/flash/smbpasswd > /mod/etc/samba/smbpasswd
cat /mod/etc/samba/smbpasswd > /var/tmp/flash/smbpasswd
auth methods = guest sam
encrypt passwords = Yes
passdb backend = tdbsam:/opt/etc/samba/smbpasswd.tdb
unix password sync = yes
pam password change = yes
passwd program = /usr/bin/passwd %u
passwd chat = *new*password* %n\n *new*password* %n\n*updated*