cygwin : cannot access to network drive - cygwin

I have some issue using cygwin to access the network drive. I have three VM(A, B, C).
Environment:
VM A(11.11.11.1) is used as NAS and I also created a share folder inside VM A. I Installed cygwin on window VM B(11.11.11.2) and map a network drive(the share folder) from VM A. I used another Linux VM C to SSH access to VM B successfully but I cant access the network drive even I use net use command.
--------Error msg:-----------
$ net use z: \\11.11.11.1\share password /user:admin System error 5
has occurred.
Access is denied.
--------end of error msg---------------
Q1) How do I solve the above access denied issue?
Q2) How do I configure VM B such a way that I can ssh to VM B to access network drive without specifiying the net use command
I tried to use mklink also not working
lrwxrwxrwx 1 Administrators NODE1+None
18 Aug 22 07:25 share -> //10.10.10.1/share lrwxrwxrwx 1
Administrators Domain Users 18 Aug
22 08:02 share1 -> //10.10.10.1/share
I tried to access share or share1. I got permission denied

Related

Unable to SSH into EC2 Instance pem 'Permissions 0777 for '.ssh/intuit-tke-qe.pem' are too open'

I'm unable to ssh into my EC2 instance, seems to be an issue with the permission level of the ssh .pem file I'm passing to ssh, googling around this seems to be a problem many others have faced but their solutions didn't work for me.
Here is what I tried, someone please help...
Atempt 1:
asemani$ ssh -i ~/.ssh/secure.pem root#54.210.0.1
********************************************************************************
This is a private computer system containing information that is proprietary
and confidential to the owner of the system. Only individuals or entities
authorized by the owner of the system are allowed to access or use the system.
Any unauthorized access or use of the system or information is strictly
prohibited.
All violators will be prosecuted to the fullest extent permitted by law.
********************************************************************************
###########################################################
# WARNING: UNPROTECTED PRIVATE KEY FILE! #
###########################################################
Permissions 0777 for '.ssh/secure.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key ".ssh/secure.pem": bad permissions
Permission denied (publickey).
Attempt 2:
asemani$ chmod 600 ~/.ssh/secure.pem
asemani$ ls -l ~/.ssh/
total 56
-rw-r--r-- 1 asemani CORP\Domain Users 782 Apr 29 11:14 config
-rw-------# 1 asemani CORP\Domain Users 1696 Apr 29 21:32 secure.pem
asemani$
asemani$ ssh -i .ssh/secure.pem root#54.210.0.1
********************************************************************************
This is a private computer system containing information that is proprietary
and confidential to the owner of the system. Only individuals or entities
authorized by the owner of the system are allowed to access or use the system.
Any unauthorized access or use of the system or information is strictly
prohibited.
All violators will be prosecuted to the fullest extent permitted by law.
********************************************************************************
Permission denied (publickey).
I don't get the warning anymore but Permission is still denied. I then also tried doing a chmod 400 on the .pem file but that also didn't work. I won't paste that here since that may be overkill.
What is happening here? How can I ssh into my ec2? This should be a simple thing??
Change permission to chmod 400 ~/.ssh/secure.pem
Are you able to login as the default user using your pem key? For Ubuntu instances, default user should be ubuntu; for most other instances it should be ec2-user. If you're able to login as the default user, chances are that root isn't allowed for ssh login. To change that, login as the default user and do the following:
# Edit sshd_config and modify 'PermitRootLogin XX' to 'PermitRootLogin yes'
sudo vi /etc/ssh/sshd_config
# Reload sshd configuration
sudo service sshd reload
NOTE: This only serves as a how-to. It's generally not recommended to allow root login over ssh for security reason.
You need to launch the instance through your AWS EC2 management console. Once it is launched, copy the public DNS IPv4 and paste it after the linux distribution name being used (e.g. ubuntu#IPv4). Also, make sure you are working in the directory that houses your private access key.
For clarification, once your EC2 instance is launched and you're in the directory that holds your private access key, type in the following in the command-line:
ssh -i private_access_key.pem linux#IPv4
to windows users can change the premise of files through wsl doing this:
Edit or create (using sudo) /etc/wsl.conf
[automount]
options = "metadata"
Restart wsl: (powershell)
PS Get-Service LxssManager | Restart-Service
and finally, do:
chmod 400 key.pem

Read-only Shared Folder for Vagrant

I would just like to ask if it's possible to share a folder from the guest VM in vagrant as a read-only to the host machine? My use case is I want to be able to see the logs of the guest VM in the host machine so I can check it using other software. I am currently using a PuPHPet generated vagrant box.
I tried to do a shared folder (with RW perms) but sadly, the direction of this is from host machine down to the guest VM. That means that the guest machine only has files if the host machine adds new files. I need the reverse of this process, which means reading the files of the guest machine from the host machine.
Thanks,
Jan
HOST: Windows 10 with Virtual Box
Guest: Ubuntu Linux 64bit
Shared directories in Vagrant are not direction dependent. A file created in the guest will show up in the host, the same as files from the host show in the guest.
Check your shared directory settings and check that you are looking in the correct directory.

chmod fails to alter permissions in Vagrant VM

I am trying to set up a Vagrant environment to host Snowplow (https://github.com/snowplow). When I launch vagrant from a cygwin shell
$vagrant up && vagrant ssh
I get into an Ubuntu guest image (12.04), and when I attempt to install java8 into this environment using ansible, I get this message:
vagrant#precise64:~$ ansible-playbook
/vagrant/ansible-playbooks/java8-gradle.yml
--inventory-file=/vagrant/home/ansible/ansible_hosts --connection=local ERROR: The file /vagrant/home/ansible/ansible_hosts is marked as executable, but failed to execute correctly. If this is
not supposed to be an executable script, correct this with chmod -x
/vagrant/home/ansible/ansible_hosts.
The file is indeed 777:
-rwxrwxrwx 1 vagrant vagrant 24 Mar 3 19:03 ansible_hosts*
but this same file is sync'd to the host (Windows) and cygwin shows the file as 644:
-rw-r--r-- 1 rcoe Domain Users 24 Mar 3 14:03 ansible_hosts
Is there a known issue running in a headless (VirtualBox) Vagrant environment that doesn't allow permissions to be set on files that are sync'd to the host?
Thanks.
It is a known deficiency, but reportedly not a bug: Changing shared folder permissions from within virtual machine
There is a good tutorial on how to set up the synced folder in vagrant so that it would suit your needs - if you navigate to that link it will show the following snippet
config.vm.synced_folder "./", "/var/sites/dev.query-auth", id: "vagrant-root",
owner: "vagrant",
group: "www-data",
mount_options: ["dmode=775,fmode=664"]
that shows how to adjust the permissions of the synced folder.
Alternatively you could also use a different method of syncing the folder, such as rsync (keeping in mind what the trade-offs are)
config.vm.synced_folder "/Users/ryansechrest/Projects/Sites", "/var/www/domains",
type: "rsync"
More on that here

Samba or smbclient can not connect to windows local disk or share like c$, d$

i am having a trouble to connect to a windows disk c or d from linux, but i can do this from windows with no problem like issuing
//192.168.1.100/C$.
From linux i do this
#smbclient '//192.168.1.100/C$' -U myuser
and get error like tree connect failed: NT_STATUS_ACCESS_DENIED
but i can connect to other shares like
#smbclient '//192.168.1.100/test_share' -U myuser
Could anyone tell me why i can't connect via linux to windows partitions
smbclient -L '//192.168.1.100/
Sharename Type Comment
--------- ---- -------
ADMIN$ Disk Remote Admin
C$ Disk Default share
test_share Disk
distr Disk
IPC$ IPC Remote IPC
Users Disk
From https://www.nooblet.org/blog/2011/access-windows-7-admin-shares-from-linux/, the following registry setting is required on the Windows machine:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"LocalAccountTokenFilterPolicy"=dword:00000001

Accessing a SMB share without a password

When accessing SMB shared that are password-protected, smbclient works just fine.
But when I'm trying to access shared that have no password protection (public shares), smbclient prints:
tree connect failed: NT_STATUS_ACCESS_DENIED
How can I access those shares?
I'm trying to access Windows 7 from my Ubuntu 12.10

Resources