PDA

Bekijk de volledige versie : NFS / adduser



akratky
12-07-2007, 23:21
I'd like to use my wlhdd as a nfs file server.
Here the exports on the wlanhdd
[admin@server_asus root]$ cat /etc/exports
# automagically generated from web settings
/tmp/harddisk/ (rw,async,no_root_squash)

the fstab on my notebook:
akratky@vaio:/mnt/spinnaker$ cat /etc/fstab | grep "192.168.0.30"
192.168.0.30:/tmp/harddisk /mnt/asus nfs user,noauto 0 0

if i try to mount the share the shell on my notbook seems to hang up or after a long periode (>3min) it is mounted .....?

Nevertheless I would prefer to use shfsmount
akratky@vaio:/mnt$ shfsmount -V
shfsmount version 0.35(2)
akratky@vaio:/mnt$ uname -a
Linux vaio 2.6.20-16-generic #2 SMP Thu Jun 7 20:19:32 UTC 2007 i686 GNU/Linux
[admin@server_asus root]$ ipkg list | grep "ssh"
denyhosts - 1.1.2-5 - DenyHosts is a script intended to be run by Linux system administrators to help thwart ssh server attacks. If you've ever looke
openssh - 4.5p1-1 - a FREE version of the SSH protocol suite of network connectivity tools.
[admin@server_asus root]$

but using it I get this error:
akratky@vaio:/mnt$ shfsmount admin@192.168.0.30 -v /mnt/asus/
cmd: exec ssh -l admin 192.168.0.30 /bin/sh, options: "version=2,mnt=/mnt/spinnaker,debug=1"
user: admin, host: 192.168.0.30, root: (null), mnt: /mnt/spinnaker, port: (null), cmd-user: 0
Testing perl... admin@192.168.0.30's password:
failed
Testing shell... ok stable
selected: shell
shfsmount: Operation not permitted
akratky@vaio:/mnt$

I would like to use nfs or shfsmount instead of smbmount to keep the rights for my files .....

#----------------------------------------------------------------------------------------------------------------------------------------------------------------
Another problem I cannot solve is to add other users. I'd like to get rid off user: admin with the pw: admin! If I add a user with adduser I can log in .... and I can also change the passwd of admin .... but after a reboot everything is lost. (which seems to be clear as only /tmp/local is saved with flashfs save && flashfs commit && flashfs enable and not /etc -> /tmp/etc) So I tried to to copy a proper passwd file from /tmp/harddisk to /etc with the /tmp/local/sbin/post-boot skript after a boot. It worked fine after a reeboot. When I switched off the power supply everthing was lost and I had to set up the whole network, all of the files in /tmp/local/sbin/ and so on. ....
To add user on http://192.168.0.30/index.asp | User Account List was also not sucsessfull!

thanks for help

alexander

PS.:
Firmware Release: 1.9.2.7-7g
Status log
Jul 13 00:27:24 /opt/sbin/sshd[345]: error: Could not get shadow information for admin
Jul 13 00:27:24 /opt/sbin/sshd[345]: Accepted password for admin from 192.168.0.9 port 48470 ssh2

vladut
24-07-2007, 11:44
Try this:
http://www.sprayfly.com/wiki/User_Management_Guides

akratky
25-07-2007, 21:21
I've tried to use the guidance as mentioned
http://www.sprayfly.com/wiki/Adduser
------------------------------------------------------------------------------------------------------
[admin@server_asus root]$ date
Wed Jul 25 21:57:28 MESZ 2007
[admin@server_asus root]$ addgroup akratky
[admin@server_asus root]$ adduser akratky -h /tmp/harddisk/akratky -G akratky
Changing password for akratky
Enter the new password (minimum of 5, maximum of 8 characters)
Please use a combination of upper and lower case letters and numbers.
Enter new password:
Re-enter new password:
Password changed.
------------------------------------------------------------------------------------------------------
[admin@server_asus root]$ cat /etc/passwd
admin:$1$$CoERg7ynjYLsj2j4glJ34.:0:0:root:/usr/local/root:/bin/sh
nobody:x:99:99:nobody:/:/sbin/nologin
akratky:$1$AIMdozlG$uR9gmNR9JvpIDacphTFUB1:500:100 :Linux User,,,:/tmp/harddisk/akratky:/bin/sh
[admin@server_asus root]$ cat /etc/group
root:x:0:admin
nobody:x:99:
akratky:x:100:
------------------------------------------------------------------------------------------------------
now I can log in with akratky
------------------------------------------------------------------------------------------------------
akratky@vaio:~$ ssh 192.168.0.30
akratky@192.168.0.30's password:
[akratky@server_asus akratky]$ date
Wed Jul 25 22:02:04 MESZ 2007
[akratky@server_asus akratky]$
------------------------------------------------------------------------------------------------------
[admin@server_asus root]$ flashfs save
tar: Removing leading '/' from member names
tmp/local/
tmp/local/etc/
tmp/local/etc/dropbear/
tmp/local/etc/dropbear/dropbear_rsa_host_key
tmp/local/etc/dropbear/dropbear_dss_host_key
tmp/local/sbin/
tmp/local/sbin/post-boot
tmp/local/sbin/post-firewall
tmp/local/sbin/post-mount
tmp/local/sbin/pre-shutdown
tmp/local/root/
tmp/local/root/.mc/
tmp/local/root/.mc/ini
tmp/local/root/.mc/history
tmp/local/root/.mc/cedit/
tmp/local/root/.mc/cedit/cooledit.macros
tmp/local/root/.mc/filepos
tmp/local/root/.mc/Tree
tmp/local/root/.ssh/
tmp/local/root/.ssh/known_hosts
tmp/local/root/.lesshst
-rw-r--r-- 1 admin root 4084 Jul 25 22:06 /tmp/flash.tar.gz
Check saved image and type "/sbin/flashfs commit" to commit changes
------------------------------------------------------------------------------------------------------
As you can see /etc/passwd is not saved!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!:confused:
------------------------------------------------------------------------------------------------------
[admin@server_asus root]$ flashfs commit
.
Committed.
------------------------------------------------------------------------------------------------------
[admin@server_asus root]$ flashfs enable
[admin@server_asus root]$ date
Wed Jul 25 22:11:46 MESZ 2007
[admin@server_asus root]$ Connection to 192.168.0.30 closed by remote host.
Connection to 192.168.0.30 closed.
akratky@vaio:~$
------------------------------------------------------------------------------------------------------
IT DOESN'T WORK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
akratky@vaio:~$ ssh 192.168.0.30
akratky@192.168.0.30's password:
Permission denied, please try again.
akratky@192.168.0.30's password:
------------------------------------------------------------------------------------------------------
[admin@server_asus root]$ cat /etc/passwd
admin:$1$$CoERg7ynjYLsj2j4glJ34.:0:0:root:/usr/local/root:/bin/sh
nobody:x:99:99:nobody:/:/sbin/nologin
[admin@server_asus root]$ date
Wed Jul 25 22:14:26 MESZ 2007
------------------------------------------------------------------------------------------------------
So after a reboot there is no user akratky:mad:

akratky
25-07-2007, 22:06
http://www.sprayfly.com/wiki/Adding_Users

adduser ..... like above

This seems to be important::)

echo "/etc/passwd" >>/usr/local/.files
echo "/etc/group" >>/usr/local/.files
flashfs save