Tag Info

Hot answers tagged

35

As a more concrete version of Kyle's answer, what you want to put in your ~/.ssh/config file is: host foo User webby ProxyCommand ssh a nc -w 3 %h %p host a User johndoe Then, when you run "ssh foo", SSH will attempt to SSH to johndoe@a, run netcat (nc), then perform an SSH to webby@foo through this tunnel. Magic! Of course, in order to do this, ...


29

Yes, just use /bin/false as shell and instruct the user to start the tunneling SSH process without executing any remote command (i.e. the -N flag for OpenSSH): ssh -N -L 1234:target-host:5678 ssh-host


18

Copying from source to target where target has sshd running: dd if=/dev/sda | gzip | ssh root@target 'gzip -d | dd of=/dev/sda' Copying from source to target via sshd_host when target is not running sshd. Target: nc -l -p 62222 | dd of=/dev/sda bs=$((16 * 1024 * 1024)) Source: ssh -L 62222:target:62222 sshd_host & Source: dd if=/dev/sda | nc ...


16

You are asking it to listen on your local port 22 and forward connections to a remote system's port 8090. You can't do that, because your local port 22 is already taken by your local SSH server. I think what you are looking for is remote forwarding. Replacing -L 22:localhost:8090 with -R 8090:localhost:22 will tell the remote host to listen on port 8090 and ...


16

You don't need to bother with all that tunneling :-). Just let mysqldump stream its data using the SSH connection: ssh usr@host mysqldump -u dbuser -ppasswd my-database-name >dumpfile


15

As you expected, this happens because SSH won't exit if there are outstanding connections going through the tunnel. If you exit your browser (and all other programs that are going through the port 9000 tunnel) then SSH should exit. The ssh man page says: The session terminates when the command or shell on the remote machine exits and all X11 and TCP ...


14

Yes. Configure the vsftp server to listen only on 127.0.0.1: this can be done in the vsftp.conf file: listen_address=127.0.0.1 To use this parameter, the server needs to be in standalone mode: listen=yes If you want to use IPv6, use these entries instead: listen_ipv6=yes listen_address6=::1 This is the same as the first, but uses IPv6. You'll ...


12

From the puTTY documentation, specifically, 4.23 The Tunnels Panel section: Set one of the ‘Local’ or ‘Remote’ radio buttons, depending on whether you want to forward a local port to a remote destination (‘Local’) or forward a remote port to a local destination (‘Remote’). Alternatively, select ‘Dynamic’ if you want PuTTY to provide a local SOCKS 4/4A/5 ...


12

Yes it is possible. Run ssh -D port user@host and set up your client to use your box as a SOCKS proxy. If you need a HTTP proxy specifically then you can use Proxychains and route it via the previous SOCKS.


11

You want to use key-based auth for this. There are dozens of questions here on SF on the topic as well as countless tutorials on the web that can walk you through how to get this set up. Not only will using key auth allow for the automation you need, but it is also a more secure means of authentication (assuming that you disable password auth at some ...


11

Your problem is in binding a listener to localhost:22; there's already an sshd listening on that. Tunnelling an ssh connection through an ssh connection is completely lawful, and I do it all the time, but you need to pick unused ports for your forwarding listeners. Try me% ssh user@100.100.100.100 -L 2201:192.168.25.100:22 then me% ssh localhost -p ...


10

SSH has a escape sequence to reset the connection, it will probably work for what you want. Press enter, then ~., yes it's enter tilde-dot. It also works when you have a hanged SSH connection (like a connection that timed out but didn't close), just press enter (I have an habit to press it more than once) and the tilde-dot sequence to close it. Some ...


10

As a normal (non-root) user, you can't bind to ports < 1024.


10

Is it good practice to copy SSH IDs a la ssh-copy-id between remote servers in production, so that they can perform various SSH tasks with one another easier? Yes, absolutely. Keep separate keys for each system, assigned to accounts with the least-needed privileges on each server. If possible use the command= directive in the authorized_keys file to ...


9

I agree with MadHatter, that it is likely to be port forwardings from defunct ssh connections. Even if your current problem turns out to be something else, you can expect to run into such defunct ssh connections sooner or later. There are three ways such defunct connections can happen: One of the two endpoints got rebooted while the other end of the ...


9

The error message ERROR 1130 (HY000): Host '178.135.138.61' is not allowed to connect to this MySQL server is coming from MySQL. To allow remote access for user root then you need to specifically allow this for the particular database, on the mysql server mysql -u root -p mysql> grant all privileges on somedatabase.* to 'root'@'178.135.138.61' ...


9

You can do this using ssh ssh -L 80:remotehost:80 user@myserver You will have a tunnel from your local port 80 to the remotehost port 80 then. This does not have to be the same as myserver. To make that transparent you should add an entry to the hosts file. If you don't do that vhosts will not work. If you want a SOCKS-proxy connection you could also use ...


9

I finally managed to accomplish this with only SSH: start a SOCKS proxy on your client machine (also using SSH) connect to server and setup a reverse port forwarding (-R) to your local SOCKS proxy configure the server software to use the forwarded proxy 1. Start local socks proxy: Connect to localhost via SSH and open SOCKS proxy on port 54321. $ ssh ...


8

I know the answer is bit late, but for the reference and for those who are still looking for the answer, Set the network.proxy.socks_remote_dns property in firefox config (type about:config in address bar) to TRUE (just double click the property to toggle the value) to enable dns lookups over your local/remote socks5 proxy. PS: I'm not sure about other ...


8

In PuTTY go to Settings -> Connection -> SSH -> Tunnels. You can add port forwards there. For reverse forward, enter source port, and destination, but choose 'Remote' instead of 'Local'. In your case, put 6000 in to source port, localhost:7000 in the Destination, and choose Remote.


8

The answer from jscott is correct, however after reading it, it was still not completely clear to me when should I use local and when remote. So I researched further, and I have found the answer here: Use local if you need to if you have a service running on a machine that can be reached from the remote machine, and you want to access it directly from the ...


8

WebDAV over SSL is as secure as the SSL implementations in the server and the client, the mechanism used for user authentication, and your trust with the certificates in use to authenticate the server computer and, if you're really paranoid, to authenticate the client computer (mutual SSL authentication isn't common, but it's certainly possible and used in ...


8

If you check the ssh man page, you'll find there is a config option called ExitOnForwardFailure and you can specify it on the command line by adding: -o "ExitOnForwardFailure yes" All the ssh config options are described in the ssh_config and sshd_config man pages. If you find the option is not supported, you may have to upgrade to a newer version of ssh. ...


7

By far, the easiest way is to just copy it via scp. Plus, this syntax actually works unlike some of the other suggestions. You can't beat this syntax for ease. It allows you to recursively copy, rsync or what ever you'd like without the hassle of considering potentially complex pipes. This syntax is intuitively clear, will be more readily supportable ...


7

ssh -L <localport>:<server2>:<server2-port> user@host Example: ssh -L 5050:server2.company.com:5050 user@host Add -f to let the ssh session run in the background. Add -g to let other hosts connect to server1s locally forwarded port.


7

You can use the ProxyCommand directive in your ~/.ssh/config file, for example to use netcat as the relay: host server2 ProxyCommand ssh server1 nc server2 22 The you would just use 'ssh server2'. The man page information for this directive is found in 'man ssh_config'


7

I trust you can already SSH to a system on the remote private network (10.0.0.0). If your local system is running openssh, add to your $HOME/.ssh/config: Host gatewaymachine LocalForward 12080 remote_ip:portnum Where 'remote_ip' is the IP address of the remote clustermachine system where gdbserver runs, and portnum is the port that it listens on. SSH to ...


7

The reason you can't do this is because you're trying to forward port 22 on the local computer to port 8090 on the remote server and something is already running on port 22 on the local server. Mostly likely you have an SSH server running. You can fix this by changing the 22 to a different value. You can check to see if a port is free by running: # netstat ...


7

I'm not familiar with DownThemAll, but I see that it's a Firefox extension. So you could try running trickle to launch Firefox with a download limit (see man trickle). For example: trickle -d 20 firefox That will set a download limit of 20 KB/s. For completeness, users running Windows can do the same by using the Firefox Throttle add-on.


7

In Linux: iptables -t nat -A OUTPUT ! -d 127.0.0.0/8 -j REDIRECT --to 1081 Run program that listens 1081, retrieves actual, non-redirected destination address, negotiates with SOCKS server and relays. I have written such program for private usage in Perl (prototype quality) and writing a better version in C. It is not yet published. Update: now ...



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