You are not logged in.
Pages: 1
When I ssh from laptop1 to laptop2, I get this error:
[user1@laptop1 ~]$ ssh user2@192.168.1.105
/usr/lib/Xorg.wrap: Only console users are allowed to run the X server
xinit: giving up
xinit: unable to connect to X server: Network is unreachable
xinit: server error
Couldn't get a file descriptor referring to the console.
Connection to 192.168.1.105 closed.I don't need X during my ssh session.
Maybe the culprit is that my laptops are configured to auto-start X on login via ~/.bash_profile
[[ -f ~/.bashrc ]] && . ~/.bashrc
[[ -z $DISPLAY && $XDG_VTNR -le 2 ]] && exec startxThanks for any advice on how to fix this!
Offline
You could check for ssh vial
if [[ -n $SSH_CLIENT ]]; then without x; else do with x; fiOffline
You could check for ssh via
if [[ -n $SSH_CLIENT ]]; then without x; else do with x; fi
Sorry, I'm newbish here -
1. Is this line to be used in ~/.bash_profile file?
2. Is it to be used on the ssh server or ssh client computer?
3. Is it pseudocode or proper syntax?
Thanks!
Last edited by latgarf (2020-11-03 11:36:04)
Offline
Why not setup a login manager on the machine instead of using startx in .bash_profile? Or just manually startx after login.
Running a shell in X, would be kinda hey let's start x, oh wait we're already running x.
ssh -Y would activate X clients on ssh client side, so startx from there would be unnecessary.
I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.
Offline
$XDG_VTNR is probably empty (check that) and the [[ test will treat that as "0" - see and try https://wiki.archlinux.org/index.php/Xi … X_at_login
Offline
If you really want to be able to start X on tty1 and tty2 of the local machine, just explicitly check whether XDG_VTNR is actually set first:
[[ -z $DISPLAY && -n $XDG_VTNR && $XDG_VTNR -le 2 ]] && exec startx"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Pages: 1