ssh with multiple users

Asked by nocibambi

We want to use the terminal as a ssh-putty client. The problem is when we type 'ssh hostname' it wants to login with the profile we logged in to Ubuntuas an username to the host.

So the question is that is there any way to make the ssh request for the host username?

Please sorry if it's obvious, we are new in Linux.

thx

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gnome-terminal Edit question
Assignee:
No assignee Edit question
Solved by:
Kris Marsh
Solved:
Last query:
Last reply:
Revision history for this message
Sam Cater (wraund-deactivatedaccount) said :
#1

run 'ssh #targetURL -l #username'

or ssh username@targeturl

Revision history for this message
Allen Chemist (alchemist) said :
#2

Sam's above solution can be used for logging in once -- that is to say it needs to be specified every time. This is good if you have different usernames on different servers.

If you have a username you always use, you can add it to your ~/.ssh/config file:
user=chelsea

The config file may not be there, so you may have to create it.

Revision history for this message
nocibambi (nocibambi) said :
#3

Thank you for the quick answer, the only thing I forgot to mention we want
to make an application launcher to the panel, which opens a terminal,
connects automatically to the host with ssh, and than requests for the
username which is have to be given by the current user (yeah we use the
Ubuntu with one profile :-).

Because of this if we want to use the solution you gave, Sam, we'll have to
create an application launcher for each user. Instead of this we want the
launcher run the terminal with an ssh command, which request for the
username. Is it possible?

Thank you in anticipation and sorry for the misconception.

On 10/22/07, Sam Cater <email address hidden> wrote:
>
> Your question #15834 on gnome-terminal in ubuntu changed:
> https://answers.edge.launchpad.net/ubuntu/+source/gnome-terminal/+question/15834
>
>
> Status: Open => Answered
>
> Sam Cater proposed the following answer:
> run 'ssh #targetURL -l #username'
>
> or ssh username@targeturl
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.edge.launchpad.net/ubuntu/+source/gnome-terminal/+question/15834/+confirm?answer_id=0
>
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.edge.launchpad.net/ubuntu/+source/gnome-terminal/+question/15834
>
>
> You received this question notification because you are a direct
> subscriber of the question.
>

Revision history for this message
Best Kris Marsh (moogman) said :
#4

Hi nocibambi,

This is possible. You will need to create a file (e.g. "yourfile") somewhere containing the following two lines:

#!/bin/bash
zenity --entry "Please enter the ssh username:" 50 10 | xargs gnome-terminal -x ssh YOURHOSTHERE -l

Remembering to change YOURHOSTHERE to whatever you like. Then you will need to make the file executable by typing the following at a terminal: chmod +x yourfile

Finally, when you create your application launcher, point it to yourfile and this should do what you want :-)

Kris

Revision history for this message
nocibambi (nocibambi) said :
#5

Thanks Kris Marsh, that solved my question.

Revision history for this message
nocibambi (nocibambi) said :
#6

Thank youm it's working fine, I only had to look after the parameters of zenity, because in your shape, in the entry section I could choose between '50', '10', and 'Please enter the ssh username' as an option.

So the shape I changed yours into:
#!/bin/bash
zenity --entry --text="Please enter the ssh username:" --title="SSH connection to YOURHOST" --width=50 --height=10 | xargs gnome-terminal -x ssh YOURHOSTHERE -l

Even so, many thanks for your help.

nB