Mac cannot access port 22 - linux

In conclusion, I cannot connect to port 22. To allow connection of port 22, I need to use ufw to set it up, but I was unable to do so on my machine.
I was trying to connect a server by running the command
ssh username#xx.xxx.xxx.xx
but I got the following errors
ssh: connect to host username#xx.xxx.xxx.xx port 22: Operation timed out
I googled it and figured out that the problem was related to port 22 connection, therefore I tried the following command as recommended.
sudo ufw allow 22/tcp
but I it seems like I need to install ufw first. I run the following command as recommended.
sudo apt-get install ufw
but It seems like I need to install apt-get. I tried to install it, but this post said Mac only use Brew. https://stackoverflow.com/questions/5231160/sudo-apt-get-command-not-found. I tried to use brew but this is what I got.
brew install ufw
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
Error: No available formula or cask with the name "ufw".
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get its complete history, run:
git -C "$(brew --repo homebrew/core)" fetch --unshallow
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.
How do I fix this issue? Thank you.

Eventually I figure out that the problem is related to my VPN. I cannot connect to the port using my current VPN. However, I could connect to the port using another computer because it uses a correct VPN.

Related

Cannot connect to the 5432 port postgres ubuntu

Well I am trying for hours to install and configure postgres in ubuntu but getting below error:
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
I have tried almost every solution I found but still no success.
Below are the commands I have used to install postgres:
sudo apt update
sudo apt install postgresql postgresql-contrib
sudo -i -u postgres
psql (After this I got an error)
The error arises during the installation of postgres.Kindly give suggestions or resources through I which I can fix this!

Installing Docker on an isolated (no internet) Centos 7 box?

I have an isolated box (no outside internet connection) that I need to install docker on. I downloaded the docker-engine-1.12.3-1.el7.centos.x86_64.rpm file from the Docker archives, and then copied it to the isolated box.
I then ran:
sudo yum localinstall --nogpgcheck docker-engine-1.12.3-1.el7.centos.x86_64.rpm
I get a failed install and this error multiple times:
https://yum.dockerproject.org/repo/main/centos/7/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to yum.dockerproject.org:443; Connection refused"
Yum gives me the suggestion to the disable the repo, and that does not work either.
How do I correctly install Docker engine on an isolated CentOS 7 box?
Might be worth running rpm -q -R -p docker-engine-1.12.3-1.el7.centos.x86_64.rpm to find out what else you need to download.
– Mark Plotnick
I ran that and I have quite a list of things to download. … That fixed it. – user1566200

Installing beanstalkd on a shared hosting account at Godaddy

I am trying to install beanstalkd (http://kr.github.io/beanstalkd/download.html) via the Linux Terminal on a shared hosting account at Godaddy.
The previous link gives commands that should install beanstalkd on the server. I use SSH (with PuTTy) to access the Linux Terminal. I have practically tried all the commands in the previous link and am consistently obtaining errors like:
sudo apt-get install beanstalkd
error message: -bash: sudo: command not found
brew install beanstalkd
error message: -bash: brew: command not found
su -c 'rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm'
su -c 'yum install beanstalkd --enablerepo=epel-testing'
error message: -bash: su: command not found
yaourt -S beanstalkd
error message: -bash: yaourt: command not found
I am not even sure what bash is exactly and if it is causing the problem, or if its because I'm using an SSH connection, or if it's really because the commands don't actually exist on the server (which would be strange because when I do man sudo or man su I do in fact get the complete manual of both commands in the terminal).
QUESTION: Why am I unable to run the previous commands to install beanstalkd on the linux server? Does it have to do with me using PuTTy (ssh connection)? What could I possibly do to get beanstalkd installed? Could it be because its shared hosting with Godaddy, and I might not have full power over the linux terminal?
SERVER INFO: When running cat /proc/version I obtain my linux distribution: Red Hat 4.4.7-16. I have a shared hosting account with Godaddy with a linux server hosting my site.
You have a RedHat distro, and they use rpm+yum for package management.
I see from yum search beanstalkd on my box that I can find it, but only on EPEL.
However, you have a really old version of RedHat, so can't just install the epel-release rpm, also, there doesn't seem to be a built version for RedHat 4.
If you had at least RedHat 5 you could do:
$ sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm
$ sudo yum install beanstalkd
You may in fact have a restricted instance of batch...
You must go to your provider's interface and do the necessary to have root access. Have you tried something like explained here?
https://uk.godaddy.com/help/enable-adminroot-access-managed-or-fully-managed-12270
If it doesn't work for you, you may also try asking https://serverfault.com/ that seems more relevant for your case.

nvm install fails on curl request

When running:
nvm install iojs-v2
I get the following error:
######################################################################## 100.0%
curl: (7) Failed to connect to localhost port 80: Connection refused
grep: /Volumes/Macintosh HD/Users/ev_blurbs/.nvm/bin/iojs-v2.5.0-darwin-x64/iojs-v2.5.0-darwin-x64.tar.gz: No such file or directory
Binary download failed, trying source.
Installing iojs from source is not currently supported
I'm not sure why the curl command is failing. Any help would be much appreciated. Thanks!
UPDATE:
I commented out all the localhost records in my /etc/host file. Now running nvm install iojs-v2 returns:
######################################################################## 100.0%
curl: (47) Maximum (50) redirects followed
grep: /Volumes/Macintosh HD/Users/ev_blurbs/.nvm/bin/iojs-v2.5.0-darwin-x64/iojs-v2.5.0-darwin-x64.tar.gz: No such file or directory
Binary download failed, trying source.
Installing iojs from source is not currently supported
UPDATE 2:
I'm using OSX 10.10.5. IOJS is trying to use Darwin. I believe that's correct, but wanted to list this.
(nvm maintainer here)
Specifically, curl: (7) Failed to connect to localhost port 80: Connection refused is the reason it's failing. Have you perhaps set a custom curl proxy?
Please try updating to the latest version of nvm; if it still doesn't work, please file an issue on the project repo and fill out the issue template.

unresolved host / Upgrade 12 to 14 Ubuntu/ Net Connection fine through browser

I recently upgraded to 'Trusty' i.e. Ubuntu 14.04. I tried pinging google.com through the terminal.
ping google.com
ping: unknown host google.com
I tried the following:
sudo apt-get remove --purge resolvconf && sudo apt-get install --reinstall resolvconf
to remove and reinstall the resolv config, but to no avail.
Then I found the official bug here: https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/1308378
I tried to do the following as instructed there:
cd /etc
sudo ln -s /run/resolvconf/resolv.conf
But it gave an error:
ln: failed to create symbolic link ‘./resolv.conf’: File exists
Internet works fine through my firefox browser. In fact, I'm writing this question through the same system.
I set additional DNS servers in the WiFi settings to the google DNS servers:
8.8.8.8, 8.8.4.4
But to no avail.
Please help.
The problem was solved on Ask Ubuntu.
Here's the link to the answer:
https://askubuntu.com/questions/584528/unresolved-host-upgrade-12-to-14-ubuntu-net-connection-fine-through-browser/584540#584540

Resources