I've set up a basic Chef infrastructure that contains a workstation, a hosted Chef Server and an Ubuntu Server to serve as a node. I'm using this setup at my workplace and therefore a proxy is required for internet connections. I've made the necessary proxy settings in both knife.rb and the Ubuntu Server. Both the workstation and the node are properly connected to the internet.
Here's the problem - When I try to bootstrap this node using knife, I get the following error:
<My Node's IP> --2014-02-12 10:29:05-- https://www.opscode.com/chef/install.sh
<My Node's IP> Resolving www.opscode.com (www.opscode.com)... 184.106.28.91
<My Node's IP> Connecting to www.opscode.com (www.opscode.com)|184.106.28.91|:443... failed: Connection refused.
<My Node's IP> bash: line 83: chef-client: command not found
Please note that I used the following command to bootstrap the node -
knife bootstrap <My Node's IP> --sudo -x <username> -P <password> -N <name>
Can you please help me with this?
Thanks in advance.
After struggling on this for a long time I have finally found the answer.
In knife.rb another entry for bootstrap-proxy has to made as well.
knife[:bootstrap_proxy] = "http://username:password#proxy:port"
After doing this, run the following bootstrap command -
knife bootstrap <My Node's IP> --sudo -x <username> -P <password> -N <name>
This worked for me!
I have encountered the same problem. You just need to type the same thing with some extra commands:
knife bootstrap <My Node's IP> --sudo -x <username> -P <password> -N <name> --bootstrap-wget-options --no-check-certificate
It will work always.
In my case, I didn't added the server in client's hosts file entry. for example,
I got this error "Connection refused - Connection refused connecting to https://server.com/organizations/sample/nodes/node1"
I simple made an entry in "/etc/hosts" file with my server's IP and name i.e "server.com" and it worked for me.
vi /etc/hosts
192.168.159.100 server.com
Related
I'm trying to connect vscode to cloud shell through ssh. I found the following article https://medium.com/#alex.burdenko/vs-code-happens-to-be-my-favorite-code-editor-and-ive-been-lucky-to-participate-so-many-diverse-952102856a7a. I followed all the steps and I'm able to ssh via the command line. However when I try to ssh via vscode I get an error.
This is what I have specified in the config file
Host tmp_user#35.186.145.21
Port 6000
ForwardAgent yes
HostName tmp_user#35.186.145.21
User tmp_user
IdentityFile ~/.ssh/google_compute_engine
When I execute gcloud alpha cloud-shell ssh --dry-run I get the following
/user/bin/ssh -t -p 6000 -i /home/tmpus/.ssh/google_compute_engine -o StrictHostKeyChecking=no tmp_user#35.186.145.21 -- DEVSHELL_PROJECT_ID=myprj 'bash -l'
Google's Cloud Code extension for VS Code should automatically connect you to Cloud Shell via SSH. You can use one of the documented links here to automatically install the extension and open a sample or you can install Cloud Code directly from the marketplace and utilize the command palette (ctrl/cmd-shift-p) to run Cloud Code: Open in Cloud Shell.... This will also create the requisite entry in your host file but please keep in mind that IPs, host names, etc are temporary and only valid while the instance of your Cloud Shell session is live. This is likely the reason your connection fails with access is denied.
Remove "tmp_user#" from the HostName field.
Try this:
Host tmp_user#35.186.145.21
Port 6000
ForwardAgent yes
HostName 35.186.145.21
User tmp_user
IdentityFile ~/.ssh/google_compute_engine
When you create cloud shell with
gcloud cloud-shell ssh --authorize-session --dry-run
In the answer you have something like this:
/usr/bin/ssh -t -p 6000 -i /home/tmp_user/.ssh/google_compute_engine -o StrictHostKeyChecking=no tmp_user#35.186.145.21 -- DEVSHELL_PROJECT_ID=XXXXXXXX 'bash -l'
So you add StrictHostKeyChecking parameter (UserKnownHostsFile /dev/null because it's temporary).
Your config file is like this:
Host tmp_user#35.186.145.21
Port 6000
ForwardAgent yes
HostName 35.186.145.21
User tmp_user
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
IdentityFile ~/.ssh/google_compute_engine
I have a Spring Boot application that runs inside a container and needs to connect to a local Postgresql database.
Now it fails at build time, as that is the moment when it tries to configure Spring beans and to connect to database.
I have configured it like following:
spring
datasource:
initialization-mode: always
platform: postgres
url: jdbc:postgresql://192.168.122.1:5432/academy
username: myuser
password: mypassword
but it fails to connect.
How shall I configure Dockerfile/connection string?
I think you have at least two alternatives
Alternative 1: Connecting via Unix domain socket
If you could have Postgres listen on a Unix domain socket, you could then pass in that socket to the container with a bind-mount. Use podman run with one of the command-line arguments --volume or --mount.
Maybe something like:
--mount type=bind,src=/path/to/socket/on/host,target=/path/to/socket/in/container
If your system has SELINUX enabled, you would need to add the option Z
--volume /path/to/socket/on/host:/path/to/socket/in/container:Z
Alternative 2: Connecting via TCP socket
I think you could add the option
--network slirp4netns:allow_host_loopback=true
to the podman run command and connect to the IP address 10.0.2.2.
Quote "Allow the slirp4netns to reach the host loopback IP (10.0.2.2, which is added to /etc/hosts as host.containers.internal for your convenience)" from the podman run man page.
See also slirp4netns.1.md.
(The IP address 10.0.2.2 is a default value hard coded in the source code of slirp4netns).
Here is an example of a container that connects to a web server running on localhost:
esjolund#laptop:~$ curl -sS http://localhost:8000/file.txt
hello
esjolund#laptop:~$ cat /etc/issue
Ubuntu 20.04.2 LTS \n \l
esjolund#laptop:~$ podman --version
podman version 3.0.1
esjolund#laptop:~$ podman run --rm docker.io/library/fedora cur-l -sS http://10.0.2.2:8000/file.txt
curl: (7) Failed to connect to 10.0.2.2 port 8000: Network is unreachable
esjolund#laptop:~$ podman run --rm --network slirp4netns:allow_host_loopback=true docker.io/library/fedora curl -sS http://10.0.2.2:8000/file.txt
hello
esjolund#laptop:~$
Please help me with this. I tried the following steps, but I am not able to connect to MongoDB.
RUN: docker run -p 27017:27017 --name my-mongo -d mongo:latest
RUN: docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' my-mongo
The output of the above command is an IP-Address. Let the IP-Address is 172.17.0.2.
Open in browser this link: http://172.17.0.2:27017/
If the following output is displayed in a browser then everything is fine: It looks like you are trying to access MongoDB over HTTP on the native driver port. I am stuck here.
Thanks
The IP Address you are trying to access is the container's private ip that is only accessible from within the docker network.
Using the parameter -p that you're specifying on the docker run you're telling docker to map a local port on your host to the port specified on the container, in this case local port 27017 to container port 27017 and after that you can access it with localhost: http://localhost:27017
Read more about this here: https://docs.docker.com/config/containers/container-networking/
I am pentesting my host using ncrack
I use such command ncrack -U login.txt -P pass.txt -iL ipList.txt -p 3389
After launching it shows me that ncrack has started and nothing happens.
What is the problem please help
This question should be on Security Stackexchange. Anyway, try to change 3389 for rdp.
You can try too removing the list using only one ip to test:
ncrack -vv -U login.txt -P pass.txt x.x.x.x:3389 where x.x.x.x is one of the ips of your list. With -vv you will see more verbose output to find out the error.
Are you sure your ips and/or hostnames on ipList.txt are accesible by network on tcp port 3389?
If not, it is a network problem.
Permit my noobishness, I'm learning how to work with Linux Openshift. While following a book, I tried to connect to the server online from the command line [Bash]. I ran
rhc port-forward
and it displayed:
Checking available ports ... done
Forwarding ports ...
To connect to a service running on OpenShift, use the Local address
Service Local OpenShift
---------- -------------- ---- ---------------
httpd 127.0.0.1:8080 => 127.7.74.1:8080
postgresql 127.0.0.1:5432 => 127.7.74.2:5432
Press CTRL-C to terminate port forwarding
The book said I should run
psql -h 127.0.0.1 -p 5433 -U username password
Now why does bash complain anytime I run the command,
psql -h 127.0.0.1 ...
It says, psql command not found.
check and make sure that you have psql installed on your local machine. If not use a package manager like yum (fedora/RHEL) or Brew (Mac) to install the necessary binaries to get the psql command.
The problem was that my internet connection breaks off at some point while I am cloning to my local machine. Thank you all for you contribution. It needs a strong internet connection and it takes quite a time to clone: https://github.com/postgres/postgres.git.