Tag Info

Hot answers tagged

7

-f -N is what you are looking for: ssh -f -N -L MY_LOCAL_PORT:FOREIGN_ADDRESS:FOREIGN_PORT MYUSER@SSH_SERVER


7

An especially good solution for scripting is to use "master" mode, with a socket for control commands: ssh -f -N -M -S <path-to-socket> -L <post>:<host>:<port> <server> To close it again: ssh -S <path-to-socket> -O exit <server> This avoids both grepping for process ids and any timing issues that might be ...


5

The feature is called ControlMaster which does multiplexing over one existing channel. It will cause you will do all key exchange and logging in only once and the later commands will go through much faster. You activate it using these three lines in you .ssh/config: Host host.com ControlMaster auto ControlPath ~/.ssh/master-%C # for openssh < 6.7 ...


4

From your workstation set up tunneling via: ssh -L8080:192.168.1.20:80 server10 Where "server10" is the public name you use to reach 192.168.1.10. This will listen locally on port 8080 and forward any data to 192.168.1.20:80 from the target host. An alternative is using the -D option for ssh for setting up a socks proxy. This will allow you to reach ...


4

My solution was similar to @slm's but I used SOCKS instead because it is simpler and required no proxy installation on the server or client. Run all commands on the computer with restricted acccess. in yum.conf set the proxy as follows proxy=socks5h://localhost:1080 from a terminal type ssh -D 1080 YOUR_USER@YOUR_SERVER_WITH_FULL_WEB_ACCESS press ...


4

You shouldn't believe everything you read on the Internet. :) There is no security problem with enabling TCPKeepAlive. There never was any such problem. The meaning of the warning in the sshd_config(5) manual is that you shouldn't rely on TCPKeepAlive alone, since an attacker can spoof it to fool the server into thinking a connection is still alive when it ...


3

Sounds like autossh (Automatically restart SSH sessions and tunnels) could be something for you: http://www.harding.motd.ca/autossh/ To keep tunnels alive, and to administrate them in general. Should be on most distros base repos, so just use one of the following: apt-get install autossh # deb pacman -S autossh # arch yum install autossh # rhel


3

With ssh -D 8080 yourserver you can start a SOCKS proxy to your home server. Configure your client to use localhost:8080 as SOCKS proxy. This method requires that port forwarding is enabled, see the AllowTcpForwarding directive in /etc/ssh/sshd_config. If you can not enable the TCP forwarding you might have a look at sshuttle. See ...


2

You should be able to proxy YUM's traffic over the SSH connection like so: add to the /etc/yum.conf on the protected server: proxy=http://127.0.0.1:8080 from the server with normal inbound/outbound ssh access: $ ssh -R 8080:ssh.server:8080 user@protected.server On the server where you want to run YUM commands: $ yum update References Port Forward ...


2

You need a desktop manager like xdm, gdm or kdm, configure it for remote access via XDMCP. Once the desktop manager on the desktop PC is set up to accept remote connections you do Xorg :1 vt8 -query <put desktop PC address here> on your netbook. KDM setup Depending on your distribution and version, the name and location of the config files may ...


2

Cisco routers has Telnet open by default. You have to explicitly make the configuration for SSH (set a domain, generase RSA, enable SSH 2.0 etc). Read the Cisco's documentation about how to configure Cisco and SSH.


2

Quite an interesting problem you've got. The real solution would be to ask your sysadmin for help first. If that's not an option, the next best thing is to have pyCharm's libssh or whatever it uses (I did some googling and couldn't figure it out) parse your `~/.ssh/config'. If that's not possible, you might be able to run your own ssh daemon on the remote ...


2

That's about it, but you've inverted home and office. The point is that the office firewall rejects outgoing connections other than web traffic. But since HTTPS traffic and SSH traffic are both encrypted, it can't easily distinguish between them, so the firewall just blocks outgoing connections to ports other than 443 (the standard HTTPS port) and probably ...


2

I believe you're getting confused by how SSH performs the proxying of the X11 connection via the tunnel it's established on the remote server side with how magic cookies typically works. From the SSH man page: excerpt The DISPLAY value set by ssh will point to the server machine, but with a display number greater than zero. This is normal, and happens ...


2

After discussing this in a chat and debugged the issue, it turned out that the required directive PermitTunnel yes was not in place and active. After adding the directive to /etc/ssh/sshd_config and reloading sshd by service sshd reload this was resolved. We added -v to the ssh command to get some debugging information and from that we found: debug1: ...


2

This looks like the linux host is configured to be some sort of RDP gateway. The command will initiate a SSH session to itself (root@localhost), start a local listener on port 3300 (L 3300:) to forward all traffic to a Windows machine on port 3389 (remote_WIN_machine1:3389), typical for RDP. I suspect that the GatewayPorts directive is set to yes in ...


2

not yet possible. there is a pull-request for oob data which seems to work for some people, though: mosh/pull/583 all credits goes to guy named tribut from #mosh channel on freenode


2

Performing SSH tunneling can get a bit confusing with all the terminology, but there is a complementary feature to -L, which provides you the ability to "dynamically" assign ports by allocating a socket locally, instead of a single port. From the man page: -D [bind_address:]port Specifies a local ``dynamic'' application-level port forwarding. This ...


1

If @St├ęphaneChazelas's suggestion of increasing ServerAliveInterval doesn't work (maybe try a value of 300), then you might want to consider something like GNU screen or tmux so you can resume your dropped connections. I have this near the top of my ~/.bashrc on all of my remote systems: screen -r >/dev/null 2>&1 This will do nothing if you ...


1

Try use sshtunnel lib. Example: from sshtunnel import SSHTunnelForwarder from time import sleep with SSHTunnelForwarder( ('localhost', 2222), ssh_username="vagrant", ssh_password="vagrant", remote_bind_address=('127.0.0.1', 3306)) as server: print(server.local_bind_port) while True: # press Ctrl-C for stopping ...


1

It's ssh client that's working on your side (local), not sshd. pgrep -l ssh should list pids and names. If no clue, try netstat -tnp|grep -F '127.0.0.1:8888'. Or run lsof -itcp@127.0.0.1:8888 and find the pid and kill. Or ssh into the remote machine, and press ~C and enter on it's own line. You'll get ssh> prompt, type -h for help. ~# lists forwarded ...


1

Does the command below work? % ssh -o ProxyCommand='ssh -p 2222 userS@SERVER /usr/bin/nc %h %p' userD@DESKTOP If so, you can bake the proxycommand into your ~/.ssh/config to make scp and sshfs calls easier.


1

Not exactly the answer you asked for, but you should be able to transfer files through an SSH connection: sending ssh user1@firewall "ssh user2@cluster \"cat > remote_file\" " < local_file fetching ssh user1@firewall "ssh user2@cluster \"cat remote_file\" " > local_file EDIT: There are also terminal based file transfer tools like ...


1

Instead of wondering how to cope with a complex chain of SSH forwardings, separate the problems. Configure your system to have transparent access to every host. This is done once and for all in your ~/.ssh/config file. To teach SSH to use a machine as a proxy to another machine, declare a ProxyCommand . Host priv-server User user ProxyCommand ssh -W ...


1

This would be simple if you try a native sshfs which is recently added. Install sudo apt-get install sshfs sshfs -ttA user@pub-server ssh user@priv-server This will do the magic. For more infor see here Linux Journal


1

Instead use a more low level form of copying files by catting them locally, and piping that into a remote cat > filename command on priv-server: $ cat file1.txt | ssh -A user@pub-server 'ssh user@priv-server "cat > file1.txt"' or with compression: $ gzip -c file1.txt | ssh -A user@pub-server 'ssh user@priv-server "gunzip -c > file1.txt"' ...


1

I am not entirely clear on what the post talks about but I have been using something similar to redirect the http traffic over ssh from a remote server which does not support X forwarding. I do it as follows: ssh -L23000:localhost:23000 user@remotehost [remotehost] $ python -m SimpleHTTPServer 23000 Open browser on localhost and point it to ...


1

Transparent Multi-hop SSH If i understand your question correctly you're looking for a solution to ssh transparently into your lab server through the machine that's visible from the outside (let's call it gate). As lbutlr mentioned first thing that comes to mind is to ssh into gate first and from there to ssh into your lab server. This works but it's not ...


1

Your question seems unclear to me, and I'm not sure why you want ssh-tunneling. How do you login to the visible machine? If that is ssh, then can't you simply ssh from that machine to the internal machines? For example, when I am away from home, I ssh to my home server, then from there I ssh to 10.0.0.125 which is my desktop machine inside my home LAN. ...


1

BindAddress is not the option you're after. From man ssh_config: BindAddress Use the specified address on the local machine as the source address of the connection. Only useful on systems with more than one address. The configuration file equivalent of -R is RemoteForward: RemoteForward Specifies that a TCP port on ...



Only top voted, non community-wiki answers of a minimum length are eligible