Last active
April 3, 2017 03:39
-
-
Save Kennyl/322f7c7e23d9f3c72883f63643cea312 to your computer and use it in GitHub Desktop.
some SSH usages: forwards X11 ( GUI ), mount folder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
if error