Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to configure ssh to login with option -Y by default?

40 views
Skip to first unread message

Peng Yu

unread,
Oct 9, 2009, 5:05:28 PM10/9/09
to
Hi,

I usually ssh with '-Y'. I'm wondering if there is a way to set it as
the default so that I don't have to type every time I run ssh.

Regards,
Peng

Dag-Erling Smørgrav

unread,
Oct 9, 2009, 5:29:19 PM10/9/09
to
Peng Yu <peng...@gmail.com> writes:
> I usually ssh with '-Y'. I'm wondering if there is a way to set it as
> the default so that I don't have to type every time I run ssh.

man ssh_config

DES
--
Dag-Erling Smørgrav - d...@des.no

Jon Solberg

unread,
Oct 10, 2009, 5:43:32 AM10/10/09
to
On 2009-10-09, Dag-Erling Smørgrav <d...@des.no> wrote:
> Peng Yu <peng...@gmail.com> writes:
>> I usually ssh with '-Y'. I'm wondering if there is a way to set it as
>> the default so that I don't have to type every time I run ssh.
>
> man ssh_config

...or create an alias for your user, for example:

alias myssh='ssh -Y'

in your shell file (.bashrc for example).

--
Jon Solberg (remove "nospam" from email address).

Peng Yu

unread,
Oct 10, 2009, 10:53:22 AM10/10/09
to
On Oct 9, 4:29 pm, Dag-Erling Smørgrav <d...@des.no> wrote:

> Peng Yu <pengyu...@gmail.com> writes:
> > I usually ssh with '-Y'. I'm wondering if there is a way to set it as
> > the default so that I don't have to type every time I run ssh.
>
> man ssh_config

Shall I set the following two options?

ForwardX11 yes
ForwardX11Trusted yes

Dag-Erling Smørgrav

unread,
Oct 10, 2009, 1:16:41 PM10/10/09
to
Peng Yu <peng...@gmail.com> writes:
> Shall I set the following two options?
>
> ForwardX11 yes
> ForwardX11Trusted yes

The first corresponds to -X, the second to -Y. IIRC, the second implies
the first, so you don't need to specify both.

Note that it is *not* a good idea to enable that unconditionally. You
should only forward your X session to machines that you trust. A typical
~/.ssh/config would look like this:

| Host *
| Compression yes
|
| Host untrusted untrusted.example.com
| HostKeyAlias untrusted.example.com
| HostName untrusted.example.com
|
| Host trusted trusted.example.com
| HostKeyAlias trusted.example.com
| HostName trusted.example.com
| ForwardX11Trusted yes

0 new messages