SSH Unable to resolve Hostname when using aliasHow to ssh to servers internally by hostname without domain...

Can't understand an ACT practice problem: Triangle appears to be isosceles, why isn't the answer 7.3~ here?

How to avoid a lengthy conversation with someone from the neighborhood I don't share interests with

Is Norway in the Single Market?

Does the problem of P vs NP come under the category of Operational Research?

Why is the Vasa Museum in Stockholm so Popular?

Who's behind community AMIs on Amazon EC2?

Accurately recalling the key - can everyone do it?

C# TCP server/client class

How long should I wait to plug in my refrigerator after unplugging it?

Is there a word that describes people who are extraverted and/or energetic, but uneducated, unintelligent and/or uncreative?

What is Albrecht Dürer's Perspective Machine drawing style?

“The Fourier transform cannot measure two phases at the same frequency.” Why not?

Ender 5: Bowden tube shifts in/out of extruder during retractions

Pronouns when writing from the point of view of a robot

What is the reason behind water not falling from a bucket at the top of loop?

How does shared_ptr<void> know which destructor to use?

Can you shove a friendly creature?

Declaring a visitor to the UK as my "girlfriend" - effect on getting a Visitor visa?

A wiild aanimal, a cardinal direction, or a place by the water

Is a switch from R to Python worth it?

Does a bard know when a character uses their Bardic Inspiration?

Why does the friction act on the inward direction when a car makes a turn on a level road?

Went to a big 4 but got fired for underperformance in a year recently - Now every one thinks I'm pro - How to balance expectations?

How to transform a function from f[#1] to f[x]



SSH Unable to resolve Hostname when using alias


How to ssh to servers internally by hostname without domain name?Alias not working with for loopFinding hostname to run SSHGit asks for password when using SSH URL, ssh does notFedora 28 - ssh - Could not resolve hostnamessh is unable to connect to server in VPNssh to another user of the same host using dns domainIf I change a user's username and password on a server, should I still be able to remotely SSH in as this user without any other changes?New User unable to login via sshWhy does git clone prompt for 'passphrase for key' when I SSH to my machine as my user?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







2















I am using Ubuntu 16.04 on an RPi 3 model B which I want to access using SSH



Using the long command:



$ ssh username@hostname


OR



$ ssh username@pi.ip.add.ress


I am able to successfully ssh into my RPi. But after creating the alias in ~/.ssh/config like:



Host myshortuser
User username
Hostname pi.ip.add.ress


and then try the command:



$ ssh myshortuser


I get the error:



ssh: Could not resolve hostname myshortuser: Temporary failure in name resolution









share|improve this question

















bumped to the homepage by Community 41 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

















  • There is no alias in your example.

    – Ipor Sircer
    May 25 '18 at 13:13






  • 2





    @Christopher: why? That's totally defeats the purpose of the Host stanza in the ssh_config. The whole point is to assign a name independent of the host name.

    – 0xC0000022L
    May 25 '18 at 13:17






  • 1





    @Christopher: every entry on the Host line can be a nickname (or alias, as Hassaan put it), as long as there is a HostName stanza. Additional rules apply. I've used this for example to fake old non-existent domain names in a CVSROOT when the server got moved.

    – 0xC0000022L
    May 25 '18 at 13:19








  • 1





    @Christopher: Editing your /etc/hosts requires privileges you may not have as ordinary user. With your advice you are subverting one of the really cool features the OpenSSH client and ssh_config(5) have to offer. It's true that your method will work, but only if the HostName stanza is removed at the same time from the SSH config file.

    – 0xC0000022L
    May 25 '18 at 13:33






  • 1





    Run ssh -vv myshortuser id 2>&1 > sshoutput.log. Then look in sshoutput.log for any errors. Your system doesn't seem to be reading the ~/.ssh/config file. That may be due to permissions, or due to a system wide restriction on reading user files.

    – Tim Kennedy
    May 25 '18 at 15:06


















2















I am using Ubuntu 16.04 on an RPi 3 model B which I want to access using SSH



Using the long command:



$ ssh username@hostname


OR



$ ssh username@pi.ip.add.ress


I am able to successfully ssh into my RPi. But after creating the alias in ~/.ssh/config like:



Host myshortuser
User username
Hostname pi.ip.add.ress


and then try the command:



$ ssh myshortuser


I get the error:



ssh: Could not resolve hostname myshortuser: Temporary failure in name resolution









share|improve this question

















bumped to the homepage by Community 41 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

















  • There is no alias in your example.

    – Ipor Sircer
    May 25 '18 at 13:13






  • 2





    @Christopher: why? That's totally defeats the purpose of the Host stanza in the ssh_config. The whole point is to assign a name independent of the host name.

    – 0xC0000022L
    May 25 '18 at 13:17






  • 1





    @Christopher: every entry on the Host line can be a nickname (or alias, as Hassaan put it), as long as there is a HostName stanza. Additional rules apply. I've used this for example to fake old non-existent domain names in a CVSROOT when the server got moved.

    – 0xC0000022L
    May 25 '18 at 13:19








  • 1





    @Christopher: Editing your /etc/hosts requires privileges you may not have as ordinary user. With your advice you are subverting one of the really cool features the OpenSSH client and ssh_config(5) have to offer. It's true that your method will work, but only if the HostName stanza is removed at the same time from the SSH config file.

    – 0xC0000022L
    May 25 '18 at 13:33






  • 1





    Run ssh -vv myshortuser id 2>&1 > sshoutput.log. Then look in sshoutput.log for any errors. Your system doesn't seem to be reading the ~/.ssh/config file. That may be due to permissions, or due to a system wide restriction on reading user files.

    – Tim Kennedy
    May 25 '18 at 15:06














2












2








2








I am using Ubuntu 16.04 on an RPi 3 model B which I want to access using SSH



Using the long command:



$ ssh username@hostname


OR



$ ssh username@pi.ip.add.ress


I am able to successfully ssh into my RPi. But after creating the alias in ~/.ssh/config like:



Host myshortuser
User username
Hostname pi.ip.add.ress


and then try the command:



$ ssh myshortuser


I get the error:



ssh: Could not resolve hostname myshortuser: Temporary failure in name resolution









share|improve this question
















I am using Ubuntu 16.04 on an RPi 3 model B which I want to access using SSH



Using the long command:



$ ssh username@hostname


OR



$ ssh username@pi.ip.add.ress


I am able to successfully ssh into my RPi. But after creating the alias in ~/.ssh/config like:



Host myshortuser
User username
Hostname pi.ip.add.ress


and then try the command:



$ ssh myshortuser


I get the error:



ssh: Could not resolve hostname myshortuser: Temporary failure in name resolution






ssh






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 25 '18 at 13:26









Prvt_Yadv

3,7613 gold badges17 silver badges34 bronze badges




3,7613 gold badges17 silver badges34 bronze badges










asked May 25 '18 at 13:12









HassaanHassaan

162 bronze badges




162 bronze badges






bumped to the homepage by Community 41 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.









bumped to the homepage by Community 41 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 41 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • There is no alias in your example.

    – Ipor Sircer
    May 25 '18 at 13:13






  • 2





    @Christopher: why? That's totally defeats the purpose of the Host stanza in the ssh_config. The whole point is to assign a name independent of the host name.

    – 0xC0000022L
    May 25 '18 at 13:17






  • 1





    @Christopher: every entry on the Host line can be a nickname (or alias, as Hassaan put it), as long as there is a HostName stanza. Additional rules apply. I've used this for example to fake old non-existent domain names in a CVSROOT when the server got moved.

    – 0xC0000022L
    May 25 '18 at 13:19








  • 1





    @Christopher: Editing your /etc/hosts requires privileges you may not have as ordinary user. With your advice you are subverting one of the really cool features the OpenSSH client and ssh_config(5) have to offer. It's true that your method will work, but only if the HostName stanza is removed at the same time from the SSH config file.

    – 0xC0000022L
    May 25 '18 at 13:33






  • 1





    Run ssh -vv myshortuser id 2>&1 > sshoutput.log. Then look in sshoutput.log for any errors. Your system doesn't seem to be reading the ~/.ssh/config file. That may be due to permissions, or due to a system wide restriction on reading user files.

    – Tim Kennedy
    May 25 '18 at 15:06



















  • There is no alias in your example.

    – Ipor Sircer
    May 25 '18 at 13:13






  • 2





    @Christopher: why? That's totally defeats the purpose of the Host stanza in the ssh_config. The whole point is to assign a name independent of the host name.

    – 0xC0000022L
    May 25 '18 at 13:17






  • 1





    @Christopher: every entry on the Host line can be a nickname (or alias, as Hassaan put it), as long as there is a HostName stanza. Additional rules apply. I've used this for example to fake old non-existent domain names in a CVSROOT when the server got moved.

    – 0xC0000022L
    May 25 '18 at 13:19








  • 1





    @Christopher: Editing your /etc/hosts requires privileges you may not have as ordinary user. With your advice you are subverting one of the really cool features the OpenSSH client and ssh_config(5) have to offer. It's true that your method will work, but only if the HostName stanza is removed at the same time from the SSH config file.

    – 0xC0000022L
    May 25 '18 at 13:33






  • 1





    Run ssh -vv myshortuser id 2>&1 > sshoutput.log. Then look in sshoutput.log for any errors. Your system doesn't seem to be reading the ~/.ssh/config file. That may be due to permissions, or due to a system wide restriction on reading user files.

    – Tim Kennedy
    May 25 '18 at 15:06

















There is no alias in your example.

– Ipor Sircer
May 25 '18 at 13:13





There is no alias in your example.

– Ipor Sircer
May 25 '18 at 13:13




2




2





@Christopher: why? That's totally defeats the purpose of the Host stanza in the ssh_config. The whole point is to assign a name independent of the host name.

– 0xC0000022L
May 25 '18 at 13:17





@Christopher: why? That's totally defeats the purpose of the Host stanza in the ssh_config. The whole point is to assign a name independent of the host name.

– 0xC0000022L
May 25 '18 at 13:17




1




1





@Christopher: every entry on the Host line can be a nickname (or alias, as Hassaan put it), as long as there is a HostName stanza. Additional rules apply. I've used this for example to fake old non-existent domain names in a CVSROOT when the server got moved.

– 0xC0000022L
May 25 '18 at 13:19







@Christopher: every entry on the Host line can be a nickname (or alias, as Hassaan put it), as long as there is a HostName stanza. Additional rules apply. I've used this for example to fake old non-existent domain names in a CVSROOT when the server got moved.

– 0xC0000022L
May 25 '18 at 13:19






1




1





@Christopher: Editing your /etc/hosts requires privileges you may not have as ordinary user. With your advice you are subverting one of the really cool features the OpenSSH client and ssh_config(5) have to offer. It's true that your method will work, but only if the HostName stanza is removed at the same time from the SSH config file.

– 0xC0000022L
May 25 '18 at 13:33





@Christopher: Editing your /etc/hosts requires privileges you may not have as ordinary user. With your advice you are subverting one of the really cool features the OpenSSH client and ssh_config(5) have to offer. It's true that your method will work, but only if the HostName stanza is removed at the same time from the SSH config file.

– 0xC0000022L
May 25 '18 at 13:33




1




1





Run ssh -vv myshortuser id 2>&1 > sshoutput.log. Then look in sshoutput.log for any errors. Your system doesn't seem to be reading the ~/.ssh/config file. That may be due to permissions, or due to a system wide restriction on reading user files.

– Tim Kennedy
May 25 '18 at 15:06





Run ssh -vv myshortuser id 2>&1 > sshoutput.log. Then look in sshoutput.log for any errors. Your system doesn't seem to be reading the ~/.ssh/config file. That may be due to permissions, or due to a system wide restriction on reading user files.

– Tim Kennedy
May 25 '18 at 15:06










1 Answer
1






active

oldest

votes


















0














please make sure the hostname is unique in your network.



sudo nano /etc/hosts --> will show the list of the hostnames.
Please change the hostname at 127.0.1.1



to make the changes effected, please run



sudo /etc/init.d/hostname.sh



sudo reboot






share|improve this answer


























  • The hostname created is unique; there is no other system in my network with the same hostname.

    – Hassaan
    May 27 '18 at 22:08














Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f445998%2fssh-unable-to-resolve-hostname-when-using-alias%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














please make sure the hostname is unique in your network.



sudo nano /etc/hosts --> will show the list of the hostnames.
Please change the hostname at 127.0.1.1



to make the changes effected, please run



sudo /etc/init.d/hostname.sh



sudo reboot






share|improve this answer


























  • The hostname created is unique; there is no other system in my network with the same hostname.

    – Hassaan
    May 27 '18 at 22:08
















0














please make sure the hostname is unique in your network.



sudo nano /etc/hosts --> will show the list of the hostnames.
Please change the hostname at 127.0.1.1



to make the changes effected, please run



sudo /etc/init.d/hostname.sh



sudo reboot






share|improve this answer


























  • The hostname created is unique; there is no other system in my network with the same hostname.

    – Hassaan
    May 27 '18 at 22:08














0












0








0







please make sure the hostname is unique in your network.



sudo nano /etc/hosts --> will show the list of the hostnames.
Please change the hostname at 127.0.1.1



to make the changes effected, please run



sudo /etc/init.d/hostname.sh



sudo reboot






share|improve this answer













please make sure the hostname is unique in your network.



sudo nano /etc/hosts --> will show the list of the hostnames.
Please change the hostname at 127.0.1.1



to make the changes effected, please run



sudo /etc/init.d/hostname.sh



sudo reboot







share|improve this answer












share|improve this answer



share|improve this answer










answered May 25 '18 at 13:36









sivasiva

12 bronze badges




12 bronze badges
















  • The hostname created is unique; there is no other system in my network with the same hostname.

    – Hassaan
    May 27 '18 at 22:08



















  • The hostname created is unique; there is no other system in my network with the same hostname.

    – Hassaan
    May 27 '18 at 22:08

















The hostname created is unique; there is no other system in my network with the same hostname.

– Hassaan
May 27 '18 at 22:08





The hostname created is unique; there is no other system in my network with the same hostname.

– Hassaan
May 27 '18 at 22:08


















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f445998%2fssh-unable-to-resolve-hostname-when-using-alias%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...