I ran an X app sudo'ed from my normal account, using:
mylappy$ ssh -Y [email protected]
[email protected]'s password:
[me@myhost ~]$ sudo su -
[root@myhost ~]# su - me -c 'xauth list' |\
grep `echo $DISPLAY |\
cut -d ':' -f 2 |\
cut -d '.' -f 1 |\
sed -e s/^/:/` |\
xargs -n 3 xauth add
Now, whenever I try to ssh in with the -Y flag, I get this error.
mylappy$ ssh -Y [email protected]
[email protected]'s password:
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Last login: Fri Apr 17 17:43:14 2015 from my.isp.com
Clearly, running this app as root wrote something somewhere that subsequent ssh sessions as me
aren't able to execute because it is root-related.
I cleaned out ~/.gnome and anything else that looked suspicious in ~. Nuked .Xauthority.
I tried running /etc/profile, /etc/bashrc, ~/.bashrc, ~/.bash_profile to see if anything there was throwing this error. Nope.
[me@myhost ~]$ . /etc/profile
[me@myhost ~]$ . /etc/bashrc
[me@myhost ~]$ . ~/.bash_profile
[me@myhost ~]$ . ~/.bashrc
Where else would ssh -Y be executing things from that might throw this error?
Note, this does not happen without the -Y flag.