Skip to content

Instantly share code, notes, and snippets.

@Kennyl
Last active April 3, 2017 03:39
Show Gist options
  • Save Kennyl/322f7c7e23d9f3c72883f63643cea312 to your computer and use it in GitHub Desktop.
Save Kennyl/322f7c7e23d9f3c72883f63643cea312 to your computer and use it in GitHub Desktop.
some SSH usages: forwards X11 ( GUI ), mount folder
sudo vi /etc/ssh/sshd_config
#Set the following two options:
#X11Forwarding yes
#X11UseLocalhost no
sudo /etc/init.d/sshd reload
sudo yum install xauth
#ssh from mac
#test if work
yum install xeyes
xeyes &
# if need gui desktop
yum groupinstall "GNOME Desktop" "Graphical Administration Tools"
brew install Caskroom/cask/xquartz
sudo vi /etc/ssh/sshd_config
#Set the following option:
#X11Forwarding yes
#gen trusted token login
#ssh keygen if no key is generated before
ssh-keygen
ssh-copy-id -p 22 <user>@linuxserver.com
ssh -X -A -p 22 <user>@linuxserver.com
# i need -Y indeed
ssh -Y -A -C -o CompressionLevel=6 -p 22 <user>@linuxserver.com
magictoken=`xauth list $DISPLAY`
echo $magictoken
#magictoken need copy paste
sudo su - <anotheruser>
xauth add $magictoken
# mount remote to local
sshfs <user>@linuxserver.com:/home/<user> ~/sshfs -C -p 22
@Kennyl
Copy link
Author

Kennyl commented Mar 8, 2017

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
if error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment