How to set default DISPLAY for all SSH sessions?

anukul

I'm SSH-ing to my PC from my phone, and I have to run export DISPLAY=:0.0 every time. Is there any way I can set it on my PC so that I don't have to do it on my phone?

silgon

You can write at the end of your .bashrc file:

export DISPLAY=:0.0

You can also have a condition for ssh

if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_CONNECTION" ]; then
    export DISPLAY=:0.0
fi

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to set a default ssh user for all hosts in Ansible?

Java web: how to set a value that accessible all user sessions?

How to set default screen colours in putty/ssh

How to record shell commands of all ssh sessions of all users accessing the same router/server to a log file in linux?

Putty color scheme for all saved sessions and default

Django sessions set default key usage

How to display items using sessions

How to add set -e to all default bashes?

How to set Default CSS for all Buttons in JAVAFx

How to set "all values" as default in a multiple select?

How to set default workspace location for all users?

How to set a default attribute to all elements

How to display all items from a Set

How to get all sessions in Vaadin

How to set sessions in Laravel 5.3

Changing the PuTTY character set for all saved sessions

How can I set persistent display settings for SSH?

How to log connect/disconnects of outgoing ssh sessions?

How to start multiple SSH sessions with single password?

Crashlytics: View all Sessions does not display all custom keys

How to set default display as year wise in Android Dialog datepicker

how to set placeholder default display in bootstrap-daterangepicker

How can I display userID in Sessions?

How to kill all tmux sessions (or at least multiple sessions) from the CLI?

How to set up password-less SSH for all users

Set gnome as default display manager

How to set default file permissions for all folders/files in a directory?

How to set "View all release pipelines" as default view in Release Pipelines

How to set default read privileges for all localhost projects?