Tag Info

Hot answers tagged

46

If you check the man page for ssh, you'll find that the syntax for -R reads: -R [bind_address:]port:host:hostport When bind_address is omitted (as in your example), the port is bound on the loopback interface only. In order to make it bind to all interfaces, use ssh -R \*:8080:localhost:80 -N root@website.com or ssh -R 0.0.0.0:8080:localhost:80 -N ...


23

if you only want to list tunnels created by ssh: % sudo lsof -i -n | egrep '\<ssh\>' ssh 19749 user 3u IPv4 148088244 TCP x.x.x.x:39689->y.y.y.y:22 (ESTABLISHED) ssh 19749 user 4u IPv6 148088282 TCP [::1]:9090 (LISTEN) ssh 19749 user 5u IPv4 148088283 TCP 127.0.0.1:9090 (LISTEN) (that would be a -L 9090:localhost:80 tunnel) if ...


20

I'd just like to quote a little from Wikipedia here: Even if a symmetric cipher is currently unbreakable by exploiting structural weaknesses in its algorithm, it is possible to run through the entire space of keys in what is known as a brute force attack. Since longer symmetric keys require exponentially more work to brute force search, a sufficiently ...


14

ssh -L opens a local port. Everything that you send to that port is put through the ssh connection and leaves through the server. If you do, e.g., ssh -L 4444:google.com:80, if you open http://localhost:4444 on your browser, you'll actually see google's page. ssh -D opens a local port, but it doesn't have a specific endpoint like with -L. Instead, it ...


13

Three slightly different methods. (Replace $PORTX and $PORTY with port numbers of your choice.) First method: ProxyCommand machine-a$ ssh -f -N -D $PORT -oProxyCommand="ssh -W %h:%p machine-b" machine-c Second method: Connect from A to B, with "local forwarding" of $PORT to localhost:$PORT. machine-a$ ssh -L $PORT:localhost:$PORT machine-b Connect ...


12

youatwork@officepc$ autossh -R 12345:localhost:22 notroot@serverpc Later: you@homepc$ autossh -L 23456:localhost:12345 notroot@serverpc you@homepc$ ssh youatwork@localhost -p 23456 What you could do is this: in step 1 forward a remote port from the office PC to the server (12345 is used as an example, any port >1024 should do). Now connecting to 12345 ...


10

If it wasn't created with multiplex enabled, you cannot. Next time, start the background session like this: ssh -f -N -M -S ~/.ssh/S.user@host.com -D 9000 user@host.com Here -M enables multiplex master mode, and -S sets the socket path. Now you can use ssh -S ~/.ssh/S.user@host.com dummyhost to open a second session over the same connection. It's ...


9

METHOD 1 (use ssh-key on inter) If you want to retain the authentication flow local -- authenticate --> inter -- authenticate (ask password) --> final This cannot be done with .ssh/config proxyhost. What you need is bash shell alias (I hope you are using bash). In ~/.bashrc, add following line alias ssh-final='ssh -t inter ssh user2@final.com' ...


9

Edit: -g works for local forwarded ports, but what you want is a reverse/remote forwarded port, which is different. What you want is this. Essentially, on website.com, set GatewayPorts=clientspecified in /etc/ssh/sshd_config. --- previous (incorrect) answer --- Use the -g option. From ssh's man page: -g Allows remote hosts to connect to local ...


7

The problem I see is that you are not going to be able to install anything like VPN software on these Internet Cafe computers, and even if you did, they could have keyloggers installed, leaving you very exposed. Frankly, I would in no way access my bank from any of them, and I would abandon your current plans. As a note: At least with TeamViewer, you ...


7

Download putty if you don't already have it, the format you need for this is: putty -ssh username@publicip -pw password -L localport:privateip:destinationport Here is what you would use to get to 192.168.1.1 remotely through SSH: putty -ssh username@publicip -pw password -L 8080:192.168.1.1:80 You could then open up a web browser to 127.0.0.1:8080 on ...


7

With -D & -L you have a way to communicate either way between the two machines. So... From the local machine, use -R to create a listenning port on the remote machine pointed at the local machine's sshd. Use -D on the remote machine, pointed at the port you created above. I "think" filling in the below will make it work... ssh remotehost -R ...


7

If you can do it, the best way is to install screen on the remote server, and run your long processes within screen. If your ssh session drops out for any reason (including timeout or simply a lost connection) the processes you are running will continue, and you can reconnect to them once you re-establish connection. If this is not an option, then create ...


6

Depends on which setup you want: SETUP 1) server is listening ssh tunel LAN destination SERVER (listen on port 6000) ==========> LAPTOP -----> ip:port (LAN destination could also be localhost:port to connect laptop itself) PUTTY SETUP: right click on putty window title, choose Change settings / Tunnels ...


6

Try MyEnTunnel. It can reconnect at connections failures.


6

He will just see an SSH connection being open and perhaps some encrypted information when he does a closer data inspection. Unless he knows the encryption keys he won't be able to see what you're doing exactly. So from the network traffic, he will not be able to see if you've been on Facebook. Don't forget about browser history though. Your sysadmin might ...


6

Simple, run the command ssh -L 25565:minecraftserverIp:25565 user@remotelinuxbox Then add a server to your minecraft client localhost:25565 This will allow you to connect to the remote minecraft server via the ssh tunnel.


6

If computer A is reachable via SSH, an SSH tunnel would be indeed the way to go: computer-B$ ssh -L 1234:localhost:80 computer-A.example.com Once you're logged in, point your browser to http://localhost:1234 and the webserver on computer A should respond. With putty, there's a "Tunnels" menu underneath the "SSH" option (left side) where you can ...


5

Also, make sure to run DNS through your SSH tunnel. In firefox, this option is disabled by default. The network admin will only see encrypted traffic, as noted above. about:config > network.proxy.socks_remote_dns;true


5

While "events generated at timed intervals" is a planned feature in Upstart, it is not ready to provide that yet. So you should write a simple script like this: #!/bin/sh service sshproxy restart And put it into /etc/cron.hourly folder. Don't forget to set an executable bit (chmod +x /etc/cron.hourly/whatever.sh), or it will not start.


5

When you ssh into the box, you are making a connection between your computer and the server; it's like you are sitting in front of the server looking at a terminal. When you run wget, the server uses its internet connection to download the file, not your home internet connection. Hopefully this graphic will help: A SSH connection: home ===> through your ISP ...


5

The initial key exchange is structured in such a way that it is not be possible for your ISP to determine the key, even if they have intercepted the entire key exchange process. This is possible because of asymmetric public-key cryptography. In assymetric cryptography, data is encrypted and decrypted using different keys (unlike symmetric cryptography, ...


5

You cannot reconnect to a session you already lost. You can only kill its processes. But if you are preparing for future, you can use tmux or screen for terminal-based programs and xpra (this fork) for X11 ones. tmux tmux ls tmux attach xpra start :100 && export DISPLAY=:100 xpra attach :100


5

The SSH server on server.com is configured to refuse all TCP forwarding attempts through it; using -L will not work. An alternative to SFTP and SCP is good old tar: ssh server.com "ssh cluster.com \"cd mydir && tar cz myfile\"" | tar xvz Or cat: ssh server.com "ssh cluster.com \"cat mydir/myfile\"" | pv > myfile The "| pv" part is ...


5

The straight ssh command for this without puTTY is... ssh user@host -L localport:routerip:remoteport and then open http://localhost:localport in your browser. Thanks to MaQleod for showing me the ssh switches. (P.S. Don't go putting passwords in plaintext! avoid the -pw switch)


5

What's wrong with using Remote Desktop? What else are you trying to achieve? You say you're coming from a Windows 7 client into a Windows 2008 server and Remote Desktop is available. I don't understand the problem. Remote Desktop Server can be configured to let you choose from different internal servers from your client at home, with the proper voodoo. ...


5

With some versions of scp (the version on the source computer seems to be the key), just re-executing the scp command will suffice to resume the transfer. But be careful! If your version doesn't support partial transfers, the partial file will simply be overwritten. The following rsync switches are handy for resuming a broken transfer if scp doesn't support ...


5

Just pull the dump with one command: ssh user@host 'mysqldump -u -p databasename' > /path/to/local/file.sql You can also compress these as well if your database is big: ssh user@host 'mysqldump -u -p databasename | gzip' > /path/to/local/file.sql.gz and then gunzip it after.


5

When using screen, you will have to copy the required environment variables manually. Detach from the screen session, run echo $DISPLAY and copy the value. Now reattach and run export DISPLAY="copied value". When you create a Screen session, the screen server automatically inherits a copy of the current environment, which is further inherited by the ...


4

Windows services must be specially written to respond to the Service Manager's control requests. You cannot use any random executable as binPath; you'll have to use srvany or similar tools. You should also use the command-line plink instead of putty, since the latter might not work properly as a service. Finally, note that PuTTY sessions are per-user, ...



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