# setsebool -P sshd_forward_ports 1 |
[userB@hostB]$ ssh -L 1234:hostA:22 userA@hostA [userB@hostB]$ ssh -p 1234 userA@localhost |
[userB@hostB]$ ssh -R 1234:localhost:22 userA@hostA [userA@hostA]$ ssh -p 1234 userB@localhost |
[userA@hostA]$ netstat -na|grep 1234 |
多くのLinuxでは、 /proc/sys/net/ipv4/ip_local_port_range でこのポート番号の範囲が32768から61000までと設定されている。 |
if [ "${SSH_CONNECTION}" = "" ]; then echo "Geant4 env setting done" else : fi |
~/.ssh/config(ユーザークライアント設定:openssh) ~/.ssh2/config(ユーザークライアント設定:ssh2) /etc/ssh/sshd_config(サーバー設定?) /etc/ssh/ssh_config(クライアント設定?) /etc/init.d/sshd restart(再起動) |
Host server1 ProxyCommand ssh -l user server2 nc %h %p |
ssh server2 |
$ cd ~/.ssh $ mkdir connections $ chmod 700 connections/ $ vim config |
Host * ControlMaster auto ControlPath ~/.ssh/connections/%r_%h_%p |
$ ssh-keygen -t rsa -f ~/.ssh/id_rsa.lan $ scp ~/.sshid_rsa.lan.pub server: $ ssh server $ cat ~/.ssh/id_rsa.lan.pub >> ~/.ssh/authorized_keys |
IdentityFile ~/.ssh/id_rsa IdentityFile ~/.ssh/id_rsa.lan |
ssh-keygen2 -t rsa emacs ~/.ssh2/identification >IdKey id_rsa_1024_a scp ~/.ssh2/id_rsa_1024_a.pub opensshサーバー:/home/user/.ssh/ |
ssh-keygen -X -f id_rsa_1024_a.pub >> ~/.ssh/authorized_keys or ssh-keygen -i -f id_rsa_1024_a.pub >> ~/.ssh/authorized_keys |
ssh-keygen -t rsa ssh-keygen -x -f ~/.ssh/id_rsa > open_client.pub scp open_client.pub ssh2サーバー:/home/user/.ssh2/ |
emacs ~/.ssh2/authorization >Key open_client.pub |
ssh -i ~/.ssh/newkey_rsa hoge@192.168.1.201 |