2

I can acces to a NAS with ubuntu file browser (path : //NAS/UBUNTU) with a login/pwd.
How can I access it with the terminal ?
"cd //NAS/UBUNTU" doesn't work.

Thanks

/dev/sda6 on / type ext4 (rw,errors=remount-ro) proc on /proc type proc (rw,nodev,noexec,nosuid) sysfs on /sys type sysfs (rw,nodev,noexec,nosuid) none on /sys/fs/cgroup type tmpfs (rw,uid=0,gid=0,mode=0755,size=1024) none on /sys/fs/fuse/connections type fusectl (rw) none on /sys/kernel/debug type debugfs (rw) none on /sys/kernel/security type securityfs (rw) udev on /dev type devtmpfs (rw,mode=0755) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620) tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755) none on /run/lock type tmpfs (rw,nodev,noexec,nosuid,size=5242880) none on /run/shm type tmpfs (rw,nosuid,nodev) none on /run/user type tmpfs (rw,nodev,noexec,nosuid,size=104857600,mode=0755) none on /sys/fs/pstore type pstore (rw) cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,relatime,cpuset) cgroup on /sys/fs/cgroup/cpu type cgroup (rw,relatime,cpu) cgroup on /sys/fs/cgroup/cpuacct type cgroup (rw,relatime,cpuacct) cgroup on /sys/fs/cgroup/memory type cgroup (rw,relatime,memory,release_agent=/run/cgmanager/agents/cgm-release-agent.memory) cgroup on /sys/fs/cgroup/devices type cgroup (rw,relatime,devices,release_agent=/run/cgmanager/agents/cgm-release-agent.devices) cgroup on /sys/fs/cgroup/freezer type cgroup (rw,relatime,freezer,release_agent=/run/cgmanager/agents/cgm-release-agent.freezer) cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,relatime,net_cls,release_agent=/run/cgmanager/agents/cgm-release-agent.net_cls) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nodev,noexec,nosuid) systemd on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,noexec,nodev,none,name=systemd) gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=thomas)

3 Answers3

2

You could use samba client which is installed in Ubuntu by default to access on Terminal. Connecting from the command line is similar to a ftp connection.

List public SMB shares with:

smbclient -L //server -U user

Connect to a SMB share with:

smbclient //server/share -U user

And then enter the password.

You can connect directly with:

smbclient //server/share -U user%password

Your password will show on the screen (less secure).

Once connected, you will get a prompt that looks like this :

smb: \>

Type help at the prompt for a list of available commands.

Tung Tran
  • 4,023
1

If you intend to access a samba share, you can use the mount command to see where the share was mounted and then accessed with the terminal. The mount will likely type "cifs". So, if you use the mount command you will see something like:

//NAS/UBUNTU on <mount point> type cifs (<options>)

so you can do a

cd <mount point>

if you want you can add to /etc/fstab an entry like this:

//NAS/UBUNTU <mount point> cifs username=<username>,password=<password> 0 0

so your share will mounted at every boot

LilloX
  • 2,027
0

You will need the smbclient command for this. It works mostly similar to the ftp command.

smbclient --user username //NAS/UBUNTU

will ask you for your password, then set up an interactive session for you to store and retrieve files. See the man page.

Jos
  • 30,529
  • 8
  • 89
  • 96