how to mount share folder cifs over stunnel?(secure samba) - linux

I configure stunnel server
accept:0.0.0.0:800
connect:127.0.0.1:139
and stunnel client
client=yes
accept:127.0.0.1:139
connect=serverip:800
and try to mount with this command
mount -t cifs -o user=x,password=y,vers=3.0,port=139 //127.0.0.1/test /mnt/test2
but throw error:
No such file or directory
but smbclient work
please help me
thanks

I change port number to 445 is solved

Related

Got error while Mounting, error massage:"mount.nfs: remote share not in 'host:dir' format"

Im trying to do mount to a nfs server as follow - mount -t nfs 127.0.0.1 /mnt/mountPointToTest (I know it is local host, it is just for testing) and I got this error message:
mount.nfs: remote share not in 'host:dir' format .
Does anyone know how I can fix this error ?
Thank you.
--
edit: after changing to mount -t nfs 127.0.0.1:/var/share /mnt/mountPointToTest
got error :
mount.nfs: No such device.
my /etc/exports looks like:
You are missing the exported remote share. Let's say you have exported /var/share as a share, then your mount command would be
mount -t nfs 127.0.0.1:/var/share /mnt/mountPointToTest

How to connect to Samba SMB2/SMB3 with domain authentication from Ubuntu 16.04 using GUI?

I can't connect to samba after blocking SMB1 protocol.
Early, I just click in Nautilus to "Connect to Server" and inputted smb://mySambaHost/. Now, I can get connected with this way.
Unhandled error message: Failed to retrieve share list from server: Connection timed out
I tried installing smbclient, but I can only connect to server whith no-friendly command (for me):
/usr/bin/smbclient \\\\my_server\\shared_folder -U WINDOWS_DOMAIN/WINDOWS_DOMAIN_USERNAME -W WINDOWS_WORKGROUP -mSMB3 and every time input password.
That is, I infer that the server and login/password are working
I tried mounted samba share_folder, but could not do it (I don't now how).
sudo mount -t cifs -o username=WINDOWS_DOMAIN/WINDOWS_DOMAIN_USERNAME,password=WINDOWS_DOMAIN_PASSWORD,rw //myServer/ /media/windowsshare
/media/windowsshare is exist
Can some help me to easely get acces to samba share folders using SMB2/SMB3 protocol?
Thanks!
Try adding the version (vers=3.0):
sudo mount -t cifs -o username=WINDOWS_DOMAIN/WINDOWS_DOMAIN_USERNAME,password=WINDOWS_DOMAIN_PASSWORD,rw,vers=3.0 //myServer/ /media/windowsshare /media/windowsshare
You could also try with 2.0 & 2.1

After mounting netapp to directory the inside directory doesn't exist

I am trying to mount our netapp but after mounting im getting weird result.
I will give the weird results. We are trying to mount a netapp DFS share.
First i tried to mount without a specific domain.
mount -t cifs -o rw,mand,user=<user>,password=<passowrd>,noserverino //ip/dfs <directory path>
The mount worked but i couldn't access the inner directories.
The message:
bash: cd: : No such file or directory
Then i tried to mount with specific domain.
mount -t cifs -o rw,mand,user=<user>,password=<passowrd>,noserverino,domain=<domainName> //ip/dfs <directory path>
The mount also worked it but now when i tried to access the directory i got the message: **
bash: cd: : Permission denied
I also know it should work because i was able to view the share via a windows 7 station and it worked perfectly.
Also, i used the file manager of gnome and used "connect to server". It also worked and i could access the inner directories.
If you need more information let me know, and thank you for the help.

Mounting a folder from other machine in linux

I want to mount a folder which is on some other machine to my linux server. To do that i am using the following command
mount -t nfs 192.xxx.x.xx:/opt/oracle /
Which is executing with the following error
mount.nfs: access denied by server while mounting 192.xxx.x.xx:/opt/oracle
Do anyone knows what's going on ??? I am new to linux.
Depending on what distro you're using, you simply edit the /etc/exports file on the remote machine to export the directories you want, then start your NFS daemon.
Then on the local PC, you mount it using the following command:
mount -t nfs {remote_pc_address}:/remote/dir /some/local/dir
Please try with your home directory as per my knowledge you can't dump anything directly on root like that.
For more reference, find full configuration steps here.

SCP command not working - need to copy file from Windows localhost to Linux

I need to copy file admin.zip from C:\wamp\www\jdhemumbai060714\webfiles (Windows) to /var/www/html/ (Linux). I am using following command::
scp C:\wamp\www\jdhemumbai060714\webfiles\admin.zip username#hostname:/var/www/html/
But it does not work and gives error::
ssh: Could not resolve hostname C: Temporary failure in name resolution
I am logged in Linux server using SSH
I think that it is bug in SCP port.
Only way is skip "C:" and use only "\wamp\www\jdhemumbai060714\webfiles\admin.zip"
It will work if current directory is on the same disk like file for upload.
Or you can use pscp.exe
Well firstly is your DNS server able to resolve the HOSTNAME your copying too? My Advice would be to use IP Address.
scp C:\wamp\www\jdhemumbai060714\webfiles\admin.zip username#192.168.0.2:/var/www/html/
BELOW ANSWER APPLICABLE ONLY FOR EC2 OR WHICH HAS PEM KEY.
Open Windows CMD, and Type
scp -i Keypair_Along_with_Path.pem YOUR_FILENAME_ALONG_WITH_PATH.txt USERNAME#PUBLIC-IP:DESTINATION_PATH
Real Example:
scp -i C:\Users\Keypair.pem C:\Users\File.txt ubuntu#1.1.1.1:/tmp/.
You are done.

Resources