简介
主要是远程到远程服务器的一些用法
- ssh配合xserver达到远程应用图像显示到本地
- linux下smb文件共享
ssh+xserver
server配置
编辑/etc/ssh/sshd_config
修改下面的值
X11Forwarding yes
X11DisplayOffset 10
一条命令
sudo sed -i 's/#X11Forwarding yes/X11Forwarding yes/g' /etc/ssh/sshd_config;
sudo sed -i 's/#X11DisplayOffset 10/X11DisplayOffset 10/g' /etc/ssh/sshd_config;
sudo systemctl restart sshd;
无桌面的server
centos
yum install -y xorg-x11-xauth xorg-x11-utils xorg-x11-fonts-*
ubuntu/debian
sudo apt-get install -y x11-apps;
windows客户端
mobaxterm一把梭
mac客户端
先安装xquartz
brew cask install xquartz
然后修改配置文件/private/etc/ssh/ssh_config
个人感觉可以是/private/etc/ssh/ssh_config
也可以是直接/etc/ssh/ssh_config
把ForwardX11 yes
的注释取消
并且添加ForwardX11Trusted yes
这样也可以远程进行sublime text3进行编辑了
附带一个pwntools用的脚本
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pwn import *
from binascii import *
BINARY_FILE = './pwn'
REMOTE = ('127.0.0.1', 10000)
def setup_connection():
binary, libc, preload = None, None, False
local_libc = '/lib/x86_64-linux-gnu/libc.so.6'
task_libc = './libc.so.6'
env = {}
if args.PRELOAD:
local_libc = task_libc
env = {'LD_PRELOAD': task_libc}
if args.BINARY:
binary = ELF(BINARY_FILE)
context.arch = binary.arch
if args.REMOTE:
if args.LIBC:
libc = ELF(task_libc)
s = remote(*REMOTE)
else:
if args.LIBC:
libc = ELF(local_libc)
s = process(BINARY_FILE, stderr=open('/dev/null', 'w+'), env=env)
if args.GDB:
context.terminal = ['gnome-terminal', '-e']
breakpoints = [0x400001, 0x400002]
gdb.attach(s, exe=BINARY_FILE, gdbscript='\n'.join(['b *'+str(x) for x in breakpoints]))
return s, binary, libc
if __name__ == '__main__':
s, binary, libc = setup_connection()
context.update(arch = 'amd64')
smb
过程
安装
sudo apt-get install samba
目录配置,最好用一个单独的目录并且chmod 777
[share]
path = dir_path
available = yes
browseable = yes
public = yes
writable = yes
设置登陆用户
sudo touch /etc/samba/smbpasswd;
sudo smbpasswd -a smb;
sudo service smbd restart