Closed.

You are watching: Nodename nor servname provided, or not known

This question does not satisfy Stack Overflow guidelines. It is not right now accepting answers.
Want to improve this question? update the concern so it's on-topic because that Stack Overflow.

Closed 9 months ago.


I to be trying to collection up a VPN with a Raspberry Pi, and also the very first step is getting the capability to ssh into the an equipment from exterior my regional network. For everything reason, this is prove to it is in impossible and also I haven\"t the slightest clue why. Once I shot to ssh into my server with user
hostname, I gain the error:

ssh: can not settle hostname : nodename nor servname provided, or not known However, I have the right to log right into the server with,

ssh user
The server is a Raspberry Pi model B to run the latest distribution of Raspbian and the maker I to be trying to connect to it with is a Macbook pro running Mavericks. Ssh was allowed on the Raspberry Pi as soon as I collection up Raspbian.

I have actually perused stack Overflow for hrs trying to see if everyone else had this problem and I have not discovered anything. Every ssh indict I uncover says that ns should just be able to set it up on the remote an equipment and log in from anywhere using a hostname, and I have never had success through that.


linux networking ssh dns
re-publishing
enhance this question
follow
edited Apr 8 \"16 at 22:57
\"*\"

halfer
18.8k1616 gold badges8080 silver badges164164 bronze title
inquiry Nov 27 \"13 in ~ 20:16
\"*\"

qaxf6auuxqaxf6auux
2,04433 yellow badges1515 silver badges1919 bronze badges
8
| present 3
much more comments

16 answer 16


energetic earliest Votes
153
If you\"re top top Mac, restarting the DNS responder resolved the concern for me.

sudo killall -HUP mDNSResponder
share
improve this price
follow
reply Nov 23 \"16 at 1:14

\"*\"

Mo BitarMo Bitar
2,30522 gold badges1010 silver- badges55 bronze badges
5
add a comment |
108
I had actually the same worry connecting to a far machine. However I controlled to login together below:

ssh -p 22 myName
hostnameor:

ssh -l myName -p 22 hostname
re-superstructure
enhance this price
monitor
edited Aug 18 \"14 at 9:52
answer Aug 18 \"14 in ~ 9:43

\"*\"

tokhitokhi
19.1k2222 yellow badges8989 silver badges103103 bronze badges
3
add a comment |
32
Recently ns came across the exact same issue. I had the ability to ssh to mine pi on mine network, yet not from external my residence network.

I had already:

installed and tested ssh on my residence network.Set a static IP for my pi.

Also, I set up harbor forward on my router for hosting a net site and also I had even port forward harbor 22 to mine pi\"s revolution IP because that ssh, but I left the field empty where friend specify the application you are performing the port forwarding because that on the router. Anyway, I added \"ssh\" right into this field and, VOILA! A working ssh link from almost everywhere to mine pi.

I\"ll write out my router\"s harbor forwarding settings.

(ApplicationTextField)_ssh (external port)_22 (Internal Port)_22 (Protocal)_Both (To IP Address)_192.168.1.### (Enabled)_checkBox

Port forwarding settings deserve to be different for various routers though, for this reason look up direction for your router.

Now, when I am exterior of my house network I connect to mine pi by typing:

ssh pi

Then ns am able come input mine password and also connect.


re-superstructure
improve this price
follow
edited Apr 8 \"16 at 22:59
\"*\"

halfer
18.8k1616 gold badges8080 silver badges164164 bronze badges
answer Feb 2 \"14 at 6:33
ekwatersekwaters
33633 silver- badges44 bronze badges
add a comment |
16
In my case I to be trying ssh like this

ssh pedro
192.168.2.179:22 when the correct format is:

ssh pedro
192.168.2.179 -p 22
re-publishing
enhance this prize
follow
answered Dec 26 \"19 in ~ 12:44
PedroPedro
36244 silver- badges1313 bronze badges
0
add a comment |
13
If you need access to your VPN from all over in the world you must register a domain name and have it allude to the general public ip attend to of your VPN/network gateway. You could additionally use a Dynamic DNS company to attach a hostname to your public ip.

If friend only must ssh from your Mac to your Raspberry inside your regional network, perform this: On her Mac, modify /etc/hosts. Suspect the Raspberry has actually hostname \"berry\" and also ip \"172.16.0.100\", include one line:

# ip hostname172.16.0.100 berryNow: ssh user
berry have to work.


re-publishing
boost this price
monitor
answer Nov 28 \"13 in ~ 11:51
grebnekegrebneke
4,1701515 silver badges2424 bronze badges
2
include a comment |
9
I had the very same issue, which i was able to fix by adding a .local to the hold name, ala ssh user
hostname.local


re-superstructure
enhance this price
follow
reply Nov 3 \"15 at 18:55
horcle_buzzhorcle_buzz
1,77111 gold badge2020 silver- badges4747 bronze title
3
add a comment |
5
If your command is:

$ ssh -p 1122 path/to/pemfile user
You will likewise face the exact same error

ssh: can not solve hostname : nodename nor servname provided, or no knownwhen you miss out on the option -i /path/to/pemfile that ssh

So Command should be:

$ ssh -p 1122 -i path/to/pemfile user

re-superstructure
improve this prize
monitor
answered Dec 10 \"16 in ~ 19:41
karthik vkarthik v
96411 yellow badge1313 silver- badges2020 bronze badges
1
include a comment |
4
I had the very same problem: The address shown in preferences -> share -> remote Login didn\"t work and I obtained a \"... Nodename no one servname provided, or not known\". However, as soon as I manually edited the setups (in preferences -> share -> far Login -> edit) and allowed \"Use dynamic an international hostname\", it unexpectedly worked.

\"*\"

\"*\"


re-superstructure
improve this price
monitor
answer Jul 22 \"15 at 2:15
user2489252user2489252
include a comment |
4
For me, the difficulty was a typo on my ~/.ssh/config file. I had:

Host host1: HostName 10.10.1.1 User jlyonsmithThe difficulty was the : after ~ the host1 - it must not it is in there. Ssh provides no warnings for typos in the ~/.ssh/config file. When it can\"t discover host1 the looks for the device locally, can\"t discover it and also prints the cryptic error message.


share
enhance this prize
monitor
answer Aug 21 \"19 in ~ 17:27
jlyonsmithjlyonsmith
73577 silver badges1515 bronze badges
include a comment |
3
I essential to attach to remote Amazon server

ssh -i ~/.ssh/test.pem -fN -L 5555:localhost:5678 ubuntu
hostname.com

I was obtaining the following error.

ssh: can not settle hostname : nodename nor servname provided, or no known

Solution because that Mac OSX

Pinging the hold resolved the issue. I am making use of Mac OSX Seirra.

ping hostname.com

Now trouble resolved. Able to attach to the server.

Note: i tried this systems also. Yet it didn\"t work out. Then ping fixed the issue.


share
improve this answer
monitor
edited might 23 \"17 at 12:26
CommunityBot
111 silver- badge
answered might 19 \"17 in ~ 20:13
mythicalcodermythicalcoder
2,6172828 silver badges3838 bronze badges
add a comment |
3
It seems that some apps won\"t check out symlinked /etc/hosts (on macOS at least), you should hardlink it.

ln /path/to/hosts_file /etc/hosts


share
boost this price
monitor
answered Oct 9 \"18 at 13:18
Andrei VaduvaAndrei Vaduva
3122 bronze badges
add a comment |
2
This was happening to me once trying to accessibility Github. The difficulty is that I remained in the habit the doing:

git remote add ssh:\\\\git
github.com......

But, if friend are having actually this error from the question, remove ssh:\\\\ might resolve the issue. It resolved it because that me!

Note the you will need to do a git remote remove and also re-add the far url without ssh:\\\\.


re-superstructure
improve this price
follow
answered may 20 \"16 in ~ 17:10
MonkpitMonkpit
2,20811 gold badge2525 silver- badges3434 bronze badges
2
add a comment |
1
I have the precise same configuration. This price pertains specifically to connecting to a raspberry pi from inside the local network (not outside). I have actually A raspberry pi ssh server, and a macbook pro, both connected to a a router. On a check router, mine mac connect perfectly when I use ssh danran
mypiserver, however, when I usage ssh danran
mypiserver top top my key router, i obtain the error

ssh: can not settle hostname : nodename nor servnameprovided, or no known

Just as you have gotten. That seems, the solution for me in ~ least, was to include a .local expansion to the hostname as soon as connecting from my mac via ssh.

So, to resolve this, i provided the command ssh danran
mypiserver.local (remember to change the \"danran\" v your username and the \"mypiserver\" through your hostname) instead of using ssh danran
mypiserver.

To anyone analysis this, try adding a .local together the suffix to your hostname you are trying to connect to. That need to solve the issue on a local network.


share
enhance this price
monitor
answered jan 12 in ~ 3:22
DanRanDanRan
11566 bronze badges
add a comment |
0
Try this, considering your permitted ports. Save your .pem file in your records folder for instance.

To gain access to it now all you have to do is cd , which moves you to the magazine of the allotted file. You can first type ls, to perform the directory contents friend are currently in:

lscd /Documentschmod 400 mycertificate.pemssh -i \"mycertificate.pem\" ec2-user
ec2-1-2-3-4.us-compass-0.compute.amazonaws.com -p 80
re-superstructure
improve this price
follow
edited Jun 11 \"17 at 16:32
karl Richter
6,6731818 gold badges5858 silver badges132132 bronze badges
answered january 31 \"16 in ~ 11:25
user4294909user4294909
add a comment |
0
I got this error by using a .yml inventory file in ansible the was not appropriately formatted. For multiple master in a group, every hostname requirements to end in a tough colon \":\". Otherwise ansible operation the host names together and produces this ssh error.

See more: What Does Increase By A Factor Of A Number? : Askscience By A Factor Of Five/Ten Etc


re-publishing
boost this prize
follow
answered january 11 \"20 at 20:14
Steve YountSteve Yount
1
add a comment |
0
I had the same problem after experimentation Visual Studio Code with remote-ssh plugin. During the setup the the remote hold the software program did ask me where to save the config-file. I believed a good place is the \".ssh-folder\" (Linux-system) as it was a ssh-remote configuration.It turned the end to it is in a poor idea. The following day, after ~ a new start that the computer system I couldn\"t logon via ssh ~ above the far server. The error blog post was \"Could not settle hostname:....... Surname or business not known\".What take place was the the uninstall indigenous VSC did not delete this config-file and also of food it was than disturbing the normal process. One \"rm\" later the problem was resolved (I go delete this config-file).


re-publishing
improve this answer
monitor
answered Oct 12 \"20 in ~ 20:45
JensJens
1
add a comment |

Not the prize you're feather for? Browse other questions tagged linux networking ssh dns or questioning your own question.


The Overflow Blog
Featured ~ above Meta
Linked
12
Could not resolve hostname git: nodename no one servname provided, or not known
0
User information needed come SSH making use of paramiko in python
1
git ssh falls short to accessibility host but succeed when direct IP is used (Windows 10)
1
Mac 10.11 with SVN 1.7.20 : can not to connect to a repository at URL
related
1
Git press error: ssh: can not solve hostname domain.com<:7555>: nodename no one servname provided, or not recognized
314
Git error: \"Host vital Verification Failed\" as soon as connecting to remote repository
242
exactly how to use Sublime over SSH
1
ssh: could not fix hostname (Docker, gitlab-ce)
1
rsub connect_to localhost: unknown hold (nodename nor servname provided, or no known)
2
Ubuntu ssh: could not fix hostname myserver: name or organization not known
0
ssh: can not settle hostname sama5d27-som1-ek-sd:
0
gaierror: nodename no one servname provided, or not known
hot Network concerns an ext hot concerns
stack Overflow
commodities
agency
stack Exchange Network
site design / logo design © 2021 stack Exchange Inc; user contributions license is granted under cc by-sa. Rev2021.9.24.40305


Stack Overflow works ideal with JavaScript enabled
\"*\"

her privacy

By click “Accept every cookies”, girlfriend agree stack Exchange can store cookies on your maker and disclose info in accordance with our Cookie Policy.