Jump to content











Photo
- - - - -

NFS client

nfs

  • Please log in to reply
1 reply to this topic

#1 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2794 posts
  • Location:Nantes - France
  •  
    France

Posted 15 December 2018 - 06:01 PM

Hello Gents,

 

Lately I discovered libnfs which is I quote (from github) is "a client library for accessing NFS shares over a network".

 

I have released a few days ago a proxy for imdisk to allow one to mount a disk image via NFS (see here).

 

This time, this is a client (GUI and command line) which I release.

 

The idea is to make it lightweight, portable and easy to use NFS client (not to mention free obviously).

I have not tested it yet but it may very well be that this works from WINPE as well.

 

I feel that this could come handy when playing with disk images on a network or when pxe booting.

That could also lead to further developpement around CloneDisk or Tiny PXE Server.

 

Download here (source code and binaries).

 

eTBeaBY.png

 

Command line syntax.

Note that the read command will dump (purposedly) the content to the console so it is up to you to pipe out to a file, etc.

nfsclient 0.1 by erwan2212@gmail.com
nfsclient 0.1 discover
nfsclient 0.1 read nfs://server/export/filename
nfsclient 0.1 write nfs://server/export/ local_filename
nfsclient 0.1 dir nfs://server/export/

Cheers,

Erwan



#2 Blackcrack

Blackcrack

    Frequent Member

  • Advanced user
  • 412 posts
  •  
    Germany

Posted 16 December 2018 - 08:47 AM

Hi Ervan.l,

you can put the whole x86 files together, also because both files use the same library,
2 packs be useful to have 2 different architectures , like x86 and the one with the 64bit enhancement (x86_64)
because later become so or so different packages.. and the gui and cmd line files be not huge and can distribute side by side..
imho, so make your not extra work ;)

allinone.jpg

this makes more easy for kick in the whole in the %windowssystem%


and for more "silly" Peoples like me, maybe rename the libnfs.exe to Guinfsc.exe
or the both exefiles to guinfsc.exeor nfscgui.exe and nfsc.exe for the more short possibility :)
then can you type a short command like:
nfsc.exe /switch1 blabla /switch2 habuba /switch3 /switch4
and the Gui executable name stay under 8 letters ..

allinone2.jpg
or
allinone3.jpg

now the next ..

connect to nfs, the sense was,
connect to an other computer and hang in a folder from an filesystem more better and directly as samba.
So it is nfs a "Network File System" and meant not directly a single file more a fileSystem..
connecting and copying to other computers ..

the mounting iso' fs is only a enhancement at nfs ..

if we see my fstab :

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
#
#
UUID=2f561c16-3058-41c4-8b4f-d9131d11a21a / ext4 defaults,noatime,discard 1 1
# Entry for /dev/sdb1 :
UUID=01D1B356AFEC8DD0 /media/sdb1 ntfs-3g defaults 0 0
# Entry for /dev/sdb3 :
UUID=4a0c1f6c-2d45-40f1-9bc6-346a5a04d939 /media/sdb3 ext4 defaults 1 2
192.168.0.20:/media/WD40EFRX-68W/linux /media/store01 nfs sync,rsize=65536,wsize=65536,soft,vers=4 0 0
192.168.0.20:/media/WD40EFRX-68W/server /media/store02 nfs sync,rsize=65536,wsize=65536,soft,vers=4 0 0
192.168.0.20:/media/WD40EFRX-68W/windows /media/store03 nfs sync,rsize=65536,wsize=65536,soft,vers=4 0 0
192.168.0.20:/media/WD40EFRX-68W/media /media/store04 nfs sync,rsize=65536,wsize=65536,soft,vers=4 0 0
192.168.0.20:/media/WD40EFRX-68W/grafic /media/store05 nfs sync,rsize=65536,wsize=65536,soft,vers=4 0 0
192.168.0.20:/media/WD40EFRX-68W/games /media/store06 nfs sync,rsize=65536,wsize=65536,soft,vers=4 0 0
192.168.0.20:/media/WD40EFRX-68W/users /media/store07 nfs sync,rsize=65536,wsize=65536,soft,vers=4 0 0
192.168.0.20:/media/WD40EFRX-68W/daten /media/store08 nfs sync,rsize=65536,wsize=65536,soft,vers=4 0 0
none /proc proc defaults 0 0
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
# Entry for /dev/sda2 :
UUID=09099bd4-301c-4742-8ec9-8a6f95f226cc swap swap defaults,noatime,discard 0 0

need we a hard/static IP-Adress (internal network)
or an Domainname.dom2IP for become the ip over the internet at 1st point
(any domain name is mapped to ip in the World Wide Web to have a human readable adress),
the next is, we need a other folder / FS to hang in where have give outside from Port ..
or in WinNT a folder or a "Virtual"Drive Letter from a exported FS for hang it in
(in WinNT it is possible mounting drives in to a folder also because the system supported it
look on the format and mounting manager of WinNT there is a possible to mount the drive to a folder),
there for need we a 2nd textfild with the possible for a pulldownmenu
for letters+openbutton for selecting a folder where it is possible to hang it in..
okey, in short, i have take your picture for add all the suggestions to have a good working NFS-Gui .

 

This is only a Picture montage ! :

eTBeaBY2.png

 

hmmm.. maybe a service for translate the Users, include root/admin ,

a service where read out the Local Users and give the possible for the admin

for setting up the UID and GID.. (+ the user must have the same Name and password )

therewith could remove the single entry of user, UID,GID and passwort and can make

a button for handling the Users of the Windowssystem+add UID and GID for nfs and let this run as service ...

together with the nfs-mount/server, therewith could it also possible to provide a share of nfs

and if there a possible for ip-pool-sharing can set up the ip pool of clients, so a internal network ...

like 192.168.0.1/40  this is from 192.168.0.1 up to 192.168.0.40

or a hard listing of ip's directly
 

When setting up the file permissions, the following rule applies:
x = 1 (execution right, for directories the right to enter
Change directories and read existing files /
write / execute, but not to display them by 'ls')
w = 2 (write right)
r = 4 (reading permission, for directories also displaying the content)
x = 5
These digits are added together for the authorization types
owner / group / others and written as a number triplet;
X / X / X
Example: chmod 762 test.file

Userrights: 4 + 2 + 1 = 7 -> read, write, exute -> rwx
Grouprights: 4 + 2 = 6 -> read, write, -> rw-
Rights of all others: 2 = 2 -> write -> -w-
-> -rwxrw--w- so ls -l test.datei

When setting the umask, these rules also apply; Example:
umask 750

Userrights: 4 + 2 + 1 = 7 -> read, write, execute -> rwx
Grouprights: 4 + 1 = 5 -> read, write, -> r-x
Rights of all others: = 0 -> -> ---
-> -rwxr-x--- at creating a file

For executable files, there is still a specialty,
the so-called Suid and Sgid bit.

It has the following on it:
Programs with the set user ID set are executed under the user ID of the file owner.

Programs with the set user ID set are executed under the group ID of the fileset.
For example, if a program belongs to root, and the suid bit is set, then the executing user has root privilege for that one program, so to speak. This is often used for programs that need to access interfaces that the average user has no access to for security reasons.
This bit is set or reset with the chmod command as above, except that an additional digit is added before the usual number triplet. If this digit is missing (the normal case), it is set to zero.

Their meaning is:

Sgid = 2 (set group ID bit, execute file as your group member)
Suid = 4 (set user ID bit, execute file as owner)
It works again as above; Example:
chmod 6711 /usr/bin/lpr


EXecutung-ID 4 + 2 = 6 -> Suid, Sgid -> °°s°°s°°°
Userrights: 4 + 2 + 1 = 7 -> read, write, execute -> rwx
GroupRights: 1 = 1 -> execute -> --x
Rights for all others: 1 = 1 -> execute -> --x
-> -rws--s--x by creating a file

This allows the normal user to use lpr to access the printer interface / dev / lp0 without being root even though it belongs to root and has no write access to it.

Watch out!
The suicide or sgid bit represents a potential security hole:
If it were possible with lpr from the above example, a commmando to that
Discontinuing the operating system, the normal user could issue arbitrary commands
Run as root, eg.


mke2fs /dev/hda1...
Therefore, one should thoroughly examine a program before setting its sui or sgid bit.
Greetings, / dev / null

with this can be able to translate to the Linux-fs and back to the WinNT-System

Local a - r - h - s
w - r - 0/" " - 1(for apache or other things at folder), so system

a-rw-s
so
7 = read/write,execute Folder
6 = a=Archive - read/write Files

5 = X=a by files = execute by Group = exec by other

0 = h=Hidden

1 = (go in/to other folder)s=System for Folder

for the owner .. if i am right..

so,
Folder:
chmod 755 for all
chmod 700 for owner
chmod 751 for Owner,Group and for all other go through the directory , as example Apache-folder inside
File:
chmod 644 read and changeable by owner, read only by group and others
chmod 640 read and changeable by owner, read only for Group
chmod 600 read and changeable by owner, all others can see the file

i don't know if 000 for files or for folders works.. :\, never testet..

so, the creating a file also for directly share it is chmod 644, for read only in group and users
for folders 755 for all others and group or setting up by configuration ..

if you use 750 is the folder for all others not allow, but if you set up 751,
can the others like apache:apache go in to the next free (755) folder and can read (644)the files
good for as example webfiles .. if in reactos extfs possible have reactos the same user and group possibility's ..

But if you set by the Users, for folders 700 or 750 and for files 600 have only the user the possibilitys to read..
but you can also set it in WinNt... with ntfs .. User Groups and others.. imho.. so should the setting up
of the user-right select-able and the possible to read out the group listing from the server... normally .. hmm
how ever ..

Exit is possible by klicking on Titlebar the "X"
or you can add more space under the List window below and add bottom right a save and close button.

i hope i have give my 2 cent ;)

best regards
Blacky







Also tagged with one or more of these keywords: nfs

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users