Sunday, May 5, 2024
9
rated 0 times [  9] [ 0]  / answers: 1 / hits: 79762  / 2 Years ago, fri, december 31, 2021, 9:01:59

Super-new linux/terminal user here-



Is it possible to use ls and cd comands directly on directories within a public folder on a NAS, or does the share need to me mounted within the root directory structure first?



If so, how would the path look?


More From » command-line

 Answers
5

This depend on how is the NAS set up?



Does it use windows sharing? Then you can use smbclient to connect to the server and there you can use lsand cd. Connect with something like smbclient //192.168.2.10/Volume1 .



Does it use ftp? Then you can use ftp to connect to the server and use cd and ls again. Connect with something like: ftp 192.168.2.10 .



Does it use sftp? Then you can use sftp to connect to the server and use cd and ls again. Connect with something like: sftp [email protected] .



And so on. So generally you don't need it to be mounted, because usually you can access the files with a client.






I expand the samba version, because you have that kind of share:




  1. You need the ip of the NAS, e.g 192.168.2.10, then you type in a terminal:



    smbclient -L=192.168.2.10


    The server will ask for a password but because you said it is a public share you don't need one, just press ENTER. Now you are presented with the shares services on the server, e.g.:



    Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.14a]

    Sharename Type Comment
    --------- ---- -------
    Volume1 Disk
    IPC$ IPC IPC Service ()
    ADMIN$ IPC IPC Service ()


    As you see I have only one Disk share named Volume1.


  2. Now you type in



    smbclient //192.168.2.10/Volume1


    or



    smbclient 192.168.2.10Volume1


    to access the Volume1 share on the server with ip 192.168.2.10. The server again asks for a password, just press ENTER.


  3. Now you are in the client and can browse the shared volume without mounting it to your file system. You can type help to get the available commands, but if you are familiar with ftp than it is basically the same. You can use ls to list the directory contents, or cd to change directory. You can exit from the client with quit.




Using this way the share is not mounted to your file system, only the client communicates with the server. (I think this was your question.)


[#27518] Sunday, January 2, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
alliulet

Total Points: 46
Total Questions: 109
Total Answers: 97

Location: Svalbard and Jan Mayen
Member since Sat, Oct 10, 2020
4 Years ago
;