How to add username when using host in /etc/hosts for ssh? Announcing the arrival of Valued...

Tannaka duality for semisimple groups

The Nth Gryphon Number

Is it dangerous to install hacking tools on my private linux machine?

My mentor says to set image to Fine instead of RAW — how is this different from JPG?

Asymptotics question

A `coordinate` command ignored

Getting out of while loop on console

Trying to understand entropy as a novice in thermodynamics

Resize vertical bars (absolute-value symbols)

How to ternary Plot3D a function

Why weren't discrete x86 CPUs ever used in game hardware?

License to disallow distribution in closed source software, but allow exceptions made by owner?

How to write capital alpha?

Is multiple magic items in one inherently imbalanced?

Why datecode is SO IMPORTANT to chip manufacturers?

Special flights

Why is it faster to reheat something than it is to cook it?

Sally's older brother

How many time has Arya actually used Needle?

Putting class ranking in CV, but against dept guidelines

What is the origin of 落第?

Is there hard evidence that the grant peer review system performs significantly better than random?

Where is the Next Backup Size entry on iOS 12?

Should a wizard buy fine inks every time he want to copy spells into his spellbook?



How to add username when using host in /etc/hosts for ssh?



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
2019 Community Moderator Election Results
Why I closed the “Why is Kali so hard” questionMaintaining `/etc/hosts` for hosts on DHCPWhy does SSH not consult /etc/hosts?How to test /etc/hostsCleanup trap for ssh command on multiple remote hostsIncreasing Productivity When SSH into Multiple HostsCannot ssh using PuTTy with a valid username and password. How to make sure server and the PuTTy keyboard / terminals are same? Other issues?Blocking telegram using /etc/hostsadding a fully qualified name for the server in /etc/hosts for oracle installationhow to configure /etc/hosts properlyUnblocking websites using /etc/hosts





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







0















I have a line specifying a server in my /etc/hosts/ file. As an example
127.0.1.1 server. When I log into the server, I usually do something like ssh username@server. Is there a way to append the username when doing something like ssh?










share|improve this question







New contributor




John Snow is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • You can use the local user's ~/.ssh/config file to specify both the remote username and IP address

    – steeldriver
    1 hour ago











  • Ah yes. So, what I wound up doing is defining the host in the /etc/hosts file and then defining the behavior with the host in ~/.ssh/config. Worked perfectly, thanks!

    – John Snow
    34 mins ago


















0















I have a line specifying a server in my /etc/hosts/ file. As an example
127.0.1.1 server. When I log into the server, I usually do something like ssh username@server. Is there a way to append the username when doing something like ssh?










share|improve this question







New contributor




John Snow is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • You can use the local user's ~/.ssh/config file to specify both the remote username and IP address

    – steeldriver
    1 hour ago











  • Ah yes. So, what I wound up doing is defining the host in the /etc/hosts file and then defining the behavior with the host in ~/.ssh/config. Worked perfectly, thanks!

    – John Snow
    34 mins ago














0












0








0








I have a line specifying a server in my /etc/hosts/ file. As an example
127.0.1.1 server. When I log into the server, I usually do something like ssh username@server. Is there a way to append the username when doing something like ssh?










share|improve this question







New contributor




John Snow is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I have a line specifying a server in my /etc/hosts/ file. As an example
127.0.1.1 server. When I log into the server, I usually do something like ssh username@server. Is there a way to append the username when doing something like ssh?







ssh users hosts






share|improve this question







New contributor




John Snow is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




John Snow is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




John Snow is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 1 hour ago









John SnowJohn Snow

1012




1012




New contributor




John Snow is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





John Snow is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






John Snow is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













  • You can use the local user's ~/.ssh/config file to specify both the remote username and IP address

    – steeldriver
    1 hour ago











  • Ah yes. So, what I wound up doing is defining the host in the /etc/hosts file and then defining the behavior with the host in ~/.ssh/config. Worked perfectly, thanks!

    – John Snow
    34 mins ago



















  • You can use the local user's ~/.ssh/config file to specify both the remote username and IP address

    – steeldriver
    1 hour ago











  • Ah yes. So, what I wound up doing is defining the host in the /etc/hosts file and then defining the behavior with the host in ~/.ssh/config. Worked perfectly, thanks!

    – John Snow
    34 mins ago

















You can use the local user's ~/.ssh/config file to specify both the remote username and IP address

– steeldriver
1 hour ago





You can use the local user's ~/.ssh/config file to specify both the remote username and IP address

– steeldriver
1 hour ago













Ah yes. So, what I wound up doing is defining the host in the /etc/hosts file and then defining the behavior with the host in ~/.ssh/config. Worked perfectly, thanks!

– John Snow
34 mins ago





Ah yes. So, what I wound up doing is defining the host in the /etc/hosts file and then defining the behavior with the host in ~/.ssh/config. Worked perfectly, thanks!

– John Snow
34 mins ago










0






active

oldest

votes












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
});


}
});






John Snow is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f513607%2fhow-to-add-username-when-using-host-in-etc-hosts-for-ssh%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes








John Snow is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















John Snow is a new contributor. Be nice, and check out our Code of Conduct.













John Snow is a new contributor. Be nice, and check out our Code of Conduct.












John Snow is a new contributor. Be nice, and check out our Code of Conduct.
















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%2f513607%2fhow-to-add-username-when-using-host-in-etc-hosts-for-ssh%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

Hudson River Historic District Contents Geography History The district today Aesthetics Cultural...

The number designs the writing. Feandra Aversely Definition: The act of ingrafting a sprig or shoot of one...

Ayherre Geografie Demografie Externe links Navigatiemenu43° 23′ NB, 1° 15′ WL43° 23′ NB, 1°...