Categories
System/Linux/Unix*

Use dd command to backup whole disk to image file , acer desktop , win7 , pv(pipe viewer example)

Acer ASPIRE M1930 partition layout Same PC but install windows7   — OK! 在 virtualbox 測試 dd if=/dev/sda | pv | ssh -p 2200 rimmon@london.monster.tw ‘cat > winxp2.dd.img’ ssh -p 2200 rimmon@london.monster.tw ‘cat winxp2.dd.img’ | pv | dd of=/dev/sda — OK! 把 Acer PC 整個硬碟備份到遠端 server 的 image file dd if=/dev/sda | pv | ssh […]

Categories
Network service System/Linux/Unix*

ssh backup command

tar zcvf – KeepTheseFiles | ssh user@desthost ‘cat > KeepTheseFiles.tgz’

Categories
System/Linux/Unix*

[memo] ssh tunnels

ssh -D 12345 -o TCPKeepAlive=yes -o ServerAliveInterval=10 -p 2200 rimmon@safe.monster.tw ssh -D 12345 -o TCPKeepAlive=yes -o ServerAliveInterval=10 rimmon@safe.monster.tw ssh -L 33389:192.168.100.2:3389 -o TCPKeepAlive=yes -o ServerAliveInterval=10 -p 2200 rimmon@safe.monster.tw   # —– ssh -L 8000:192.168.1.1:80 -o TCPKeepAlive=yes -o ServerAliveInterval=10 -p 2200 rimmon@desktop.monster.tw 說明: 在本機端(port 8000) 建立一個與 desktop.monster.tw 的 ssh (port 2200) 通道, 由 desktop.monster.tw 連向 192.168.1.1 […]

Categories
System/Linux/Unix*

Protected: My NAT port forward setting / forwarding / forward rules / port mapping

There is no excerpt because this is a protected post.

Categories
System/Linux/Unix*

Use Subversion with SSH on non standard port / svn on ssh tunnels

server 端: rimmon@chicago:~$ pwd /home/rimmon rimmon@chicago:~$ svnadmin create SVN 改 SVN/conf/svnserve.conf [general] anon-access = none password-db = passwd realm = Chicago_SVN — client 端: 在 ~/.subversion/config 加上 ### Section for configuring tunnel agents. [tunnels] mmm = ssh -p 2200 -q — checkout : svn co svn+mmm://chicago.monster.tw/home/rimmon/SVN .     cat .subversion/config   [tunnels] foo = ssh -p […]

Categories
Uncategorized

2016.0509 Disabling reverse dns lookups in ssh

edit /etc/ssh/sshd_config add line: UseDNS no

Categories
Programming/php Software

[memo] 在 PHP 使用 ssh tunnel 連接遠端的 mysql server

 

Categories
System/Linux/Unix*

Use ssh fs exmple command , sshfs

For mount: sshfs -o idmap=user -p 2200 username@hostname:/ /home/username/dir   To unmount, fusermount -u /home/username/dir    

Categories
System/Linux/Unix*

backup AWS script using rsync and ssh

# rsync -av -e ssh directory_name rimmon@192.168.100.10:/Volumes/disk/BK-svr-london # rsync -avz -e ‘ssh -i 遠端的KEY’ 遠端帳號@遠端IP:遠端目錄 近端目錄 # —— —— example: cat RUN_backup_aws.sh #/bin/sh /usr/bin/rsync -avz -e ‘ssh -i /home/xxx/_AWS/key_xxx.pem’ ec2-user@www.monster.com.tw:/etc /home/xxx/_AWS/BACKUP /usr/bin/rsync -avz -e ‘ssh -i /home/xxx/_AWS/key_xxx.pem’ ec2-user@www.monster.com.tw:/var/www /home/xxx/_AWS/BACKUP /usr/bin/rsync -avz -e ‘ssh -i /home/xxx/_AWS/key_xxx.pem’ ec2-user@www.monster.com.tw:/home/ec2-user /home/xxx/_AWS/BACKUP

Categories
System/Linux/Unix*

login remote ssh delay 等很久

改 /etc/ssh/sshd_config 加一行: UseDNS no