Hot answers tagged

42

You may want to use scp for this purpose. It is a secure means to transfer files using the SSH protocol. For example a file yourfile.txt from ~/Downloads to remote computer. scp ~/Downloads/yourfile.txt your_username@remotehost.edu:/some/remote/directory You can see more examples on. http://www.hypexr.org/linux_scp_help.php


40

OK, I've just found it, and it still works! Really funny. You don’t need any fancy applications, instant messengers or the like. With this command you send your audio to the remote host. arecord -f cd -t raw | oggenc - -r | ssh <user>@<remotehost> mplayer - Or if you like ffmpeg better ffmpeg -f alsa -ac 1 -i hw:3 -f ogg - \ | ssh <...


38

Though scp is clearly the right tool for this, if for some reason you can't use it you could do something like the following from your local machine to copy, say, a directory structure to the remote machine: tar -c . | ssh <remote> tar -x This will tar the current directory on the local machine, and write that tar to stdout which will then be piped ...


30

If your intent is to backup a remote computer's HDD A via SSH to a single file that's on your local computer's HDD, you could do one of the following. Examples run from remote computer $ dd if=/dev/sda | gzip -1 - | ssh user@local dd of=image.gz run from local computer $ ssh user@remote "dd if=/dev/sda | gzip -1 -" | dd of=image.gz Live example $ ...


21

SSHFS is wonderful; it can mount remote directories in a local directory. You could install ssh on both sides: # apt-get install ssh On the client side, or both sides if desired, install sshfs and fuse utilities: # apt-get install fuse-utils sshfs Without reboot, load the kernel module: # modprobe fuse Create a mount point for the remote file ...


18

You can use X11 forwarding over SSH; make sure the option X11Forwarding yes is enabled in /etc/ssh/sshd_config, and either enable X11 forwarding by hand with ssh -X remoteserver or add a line saying ForwardX11 yes to the relevant host entry in ~/.ssh/config Of course, that requires a working X display at the local end, so if you're using Windows ...


18

Has been an issue with firefox for quite a while, try running firefox as firefox -no-remote (setting MOZ_NO_REMOTE=1 as environment variable should work as well). Here's more info


17

If you want to do this on more than the rare occasion, I'd suggest mounting the remote filesystem with sshfs if you are using a Unix-like that supports FUSE (Linux, *BSD, Mac OS X). Make a directory under your home directory, say, called ~/remote-server: $ mkdir ~/remote-server Then mount the remote filesystem with sshfs. Replace "yourserver.com" ...


15

You can use plenty of things, among which, popular options are: NFS Samba / CIFS SSHFS By ease-of-setup I think they would have to be put in this order (top: easiest) SSHFS Through FUSE, you can mount remote filesystems via ssh. I won't cover how, as Cristopher has already very well explained that. Just note that, in order to mount the file ...


13

The reason you are not getting the correct error code is because local is actually the last thing executed. You need to declare the variable as local prior to running the command. local RESULTS RESULTS=$(ssh user@server /usr/local/scripts/test_ping.sh) echo $? You can see the issue here: $ bar() { foo=$(ls asdkjasd 2>&1); echo $?; }; bar 2 $ bar() ...


12

You may find useful xinput list and xinput test <device>. For example, $ xinput list ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ SynPS/2 Synaptics TouchPad id=11 [slave pointer (2)] ⎣ Virtual core keyboard id=3 ...


11

You'll need to download the content of the script in some way. You could do ssh remote-host cat script.bash | bash But that would have the same kind of problem as: cat script.bash | bash namely that stdin within the script would be the script itself (which could be an issue if commands within the script need to get some input from the user). Then, a ...


11

You can mount the remote directory with sshfs, after that, the file is accessible in your local directory tree. Example: sshfs user@domain:/remote/directory/ /local/directory/ It's all in the man pages. Or just copy the file over with scp/rsync, edit it, and copy it back.


10

One simple way is to turn on vnc screen sharing by going to System Preferences -> Sharing -> Screen Sharing on the machine you want to share. For client compatibility reasons you may need to select both "Anyone may request permission to control this screen" and the "VNC viewers may control this screen with a password" checkboxes. Once you've set up the ...


10

rsync is able to do this. rsync --ignore-existing <src> <dest> You can perform also various kinds of updates. Just have a look at the man page.


10

In a screen or tmux session, set up a shell that will reverse your changes after a delay. I don't know anything about iptables, so can't help with that, but something like this has saved my proverbial bacon on numerous occasions while altering live firewall configs on FreeBSD: # In one `screen` or `tmux` window % sleep 60 && <command to reverse ...


9

There is no standard per-user file that is run for non-interactive logins. You need to either make the program self-contained, so that it's able to find its dependencies without relying on non-default environment variables, or else explicitly set the environment, typically with ssh somehost '. ~/.profile; exec ~/some/path/somescript.py' You shouldn't be ...


9

No packets are received for several seconds and then ~6 are sent back in quick succession. This is symptomatic of two similar phenomena: network congestion or network discards (usually due to congestion). In the first case, a router between here and there has a burst of traffic unrelated to your activities which cause your traffic to be buffered in some ...


9

For SSH: tar czf - . | ssh remote "( cd /somewhere ; cat > file.tar.gz )" For SFTP: outfile=/tmp/test.tar.gz tar cvf $outfile . && echo "put $outfile" | sftp remote:/tmp/ Connecting to remote... Changing to: /tmp/ sftp> put /tmp/test.tar.gz Uploading /tmp/test.tar.gz to /tmp/test.tar.gz /tmp/test.tar.gz Another SFTP: outfile=/tmp/test....


8

Short answer: ssh -t fs "stty isig intr ^N -echoctl ; trap '/bin/true' SIGINT; sleep 1000; echo f" > foo and stop the program by CTRL+N. Long explanation: You must use stty option intr to change your server or local interrupt character to not collide with each other. In the command above I've changed the server interrupt character to CTRL+N. You can ...


8

If you want to run a X command on a remote system and and show the client on your local system the solution is rather simple: You have to ensure that your X Server accepts connection via TCP, nowadays this is typically disabled as it is a security problem. You basically have to run your Xorg server without the -nolisten tcp option. For gdm3 you can add ...


8

You can use : sudo dpkg-reconfigure tzdata for configuring your timezone . For updating time and date from internet use the following : Install If ntpd is not installed use any one of the following command to install ntpd: # yum install ntp Configuration You should at least set following parameter in /etc/ntp.conf config file: server For example,...


8

This can be done by installing Cygwin and an openssh server on your Windows machine. Cygwin will come with bash, which can run your script, and openssh can be installed under Cygwin, and will allow you to login to the Windows machine remotely. Before logging in, you can transfer your script to the Windows machine using scp, and then run it directly with ssh. ...


8

If you can install software on your work computer, then you could install win-sshfs and a ssh client such as PuTTY on your Windows machine. You can then ssh into the remote Ubuntu server to run LaTex and create your files, after which you could use win-sshfs to access those files from the Windows machine. This way, you'd only need the one ssh port open on ...


8

First time, there is no real difference between scp (copy over ssh) and rsync. Subsequent runs will benefit by rsync not copying files that already exist. rsync -avH ~/Downloads username@remotehost:Downloads -a for all files -v for verbose -H for "just figure out symlinks and do the right thing" then source and destination paths. You can use wildcards ...


8

To extract your files, you need to use gzip: gzip -d *.jpg.gz You mention doing this recursively; given that you don't have find, you'll have to visit each directory in turn and run the above command.


8

If shell of the host you are sshing to is bash version >= 4.0, you can enable the globstar option. When enabled, the ** glob will recursively match subdirectories. So the following should do what you need: shopt -s globstar for gz_file in **/*.jpg.gz; do gzip -d "$gz_file" done No manual recursing into subdirectories required.



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