In SSH, how do I mv to my local system?

1

First things first: ssh is a way to remotely login to another computer. The shell (command line) you get after you ssh is (pretty much) the same as if you had opened a xterm in the remote machine. If offers no such way to move files.

However, the fact that the remote computer accepts ssh connections gives you some options to exchange files:

Use scp To copy from your local computer to the remote, type, in the local computer:

scp /tmp/file user@example.com:/home/name/dir

(where /tmp/file can be replaced with any local file and /home/name/dir with any remote directory)

To copy from the remote computer to the local one, type, in the local computer:

scp user@example.com:/home/name/dir/file /tmp

Use sshfs This is a little more advanced but much, much nicer (when the internet connection of both computers is good. If not, stick to scp)

You can "link" a directory from the remote computer to an (empty) directory of the local computer....

0 0
2

Probably bad searching/not knowing the terminology, but: I've managed to ssh into my webhost's directory for me, and tar the webapp I want to back up and download. But when I try to mv to ~/mydirectory/backups or mv to /home/mydirectory/backups, it defines the "home" as my root on the webhost that I'm ssh'ed into.

How do I mv in ssh to a local drive while still "inside" the webhost's system?

First things first: ssh is a way to remotely login to another computer. The shell (command line) you get after you ssh is (pretty much) the same as if you had opened a xterm in the remote machine. If offers no such way to move files.

However, the fact that the remote computer accepts ssh connections gives you some options to exchange files:

Use scp To copy from your local computer to the remote, type, in the local computer:

scp /tmp/file user@example.com:/home/name/dir

(where /tmp/file can be replaced with any local file and /home/name/dir with any...

0 0
3

So, I am trying to create an ask system there one computer (,lets call it computer nr1,) asks another computer (computer nr2) a question. The answer will be replied through a textdocument in the computer nr1. The question nr1 can be asking doesn’t really matter atm, but let say nr1 ask when nr2 last rebooted.

I am using ssh to ask the question but it doesn’t work. I’m sshing nr1 to nr2 and then, for example, asking when it last rebooted by:

who -b | awk '{print $(NF-1)" "$NF}' >> existing_file_in_nr1.txt

But when I run the command it places the answer in computer nr2.
What do I do if i want my reply to go to computer nr1 instead of computer nr2 when sshed from nr1 to...

0 0
4

Copy the file "foobar.txt" from a remote host to the local host:

$ scp your_username@remotehost.edu:foobar.txt /some/local/directory

Copy the file "foobar.txt" from the local host to a remote host:

$ scp foobar.txt your_username@remotehost.edu:/some/remote/directory

Copy the directory "foo" from the local host to a remote host's directory "bar":

$ scp -r foo your_username@remotehost.edu:/some/remote/directory/bar

Copy the file "foobar.txt" from remote host "rh1.edu" to remote host "rh2.edu":

$ scp your_username@rh1.edu:/some/remote/directory/foobar.txt your_username@rh2.edu:/some/remote/directory/

Copying the files "foo.txt" and "bar.txt" from the local host to your home directory on the remote host:

$ scp foo.txt bar.txt your_username@remotehost.edu:~

Copy the file "foobar.txt" from the local host to a remote host using port 2264:

$ scp -P 2264 foobar.txt...

0 0
5

The default port for SSH (port 22) is blocked for security reasons.

On the Red Hat systems you will need to edit the sshd config file located at /etc/sshd/sshd_config.

You will need to change the line where it says either PORT 22 or #Port 22 and then restart sshd for the changes to take effect.

Example:

sudo nano /etc/ssh/sshd_config

Top of file before edit(yours might look slightly different):

# $OpenBSD: sshd_config,v 1.73 2005/12/06 22:38:28 reyk Exp $

# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.

#Port 22
#Protocol 2,1
Protocol 2
...

0 0
6

#. "SSH" is used for securely logging into remote systems. Basically it's a protocol. On UNIX-based systems, "openssh" is used, while on Window$ system, it’s implemented with tools, like "putty".
#. It has a client-server architecture. The ssh-client connects the listening server on port 22 (by default, though you can change it).
#. Some basic examples are:

ssh user@hostname:22 ssh -i key.pem user@remote_ip

You can understand the syntax very easily. Please Google it. Check Wikipedia and official documentation.
#. ssh has been used widely in industry. As cloud computing is on its peak, everyone has to deal with it. You must have knowledge regarding ssh protocol & its implementation, in order to work in IT...

0 0
7

I ssh-ed into my webhost's directory, and tar-ed the webapp to download. When I try to mv to ~/mydirectory/backups or /home/mydirectory/backups, it defines the "home" as my root on the webhost that I'm ssh'ed into.

How do I mv in ssh to a local drive while still being inside the webhost's system?

First things first: ssh is a way to remotely login to another computer. The shell (command line) you get after you ssh is (pretty much) the same as if you had opened a xterm in the remote machine. If offers no such way to move files.

However, the fact that the remote computer accepts ssh connections gives you some options to exchange files:

Use scp To copy from your local computer to the remote, type, in the local computer:

scp /tmp/file [email protected]:/home/name/dir

(where /tmp/file can be replaced with any local file and /home/name/dir with any remote directory)

To copy from the remote computer to the local one, type, in the local...

0 0
8

wikiHow's mission is to help people learn, and we really hope this article helped you. Now you are helping others, just by visiting wikiHow.

Direct Relief is a humanitarian nonprofit with a mission to improve the health and lives of people affected by poverty and emergencies. Recognized by Charity Navigator and Forbes for its efficiency, Direct Relief equips health professionals in the U.S. and throughout the world with essential medical resources to effectively treat and care for patients – without regard to politics, religion, or ability to pay.

Click below to let us know you read this article, and wikiHow will donate to Direct Relief on your behalf. Thanks for helping us achieve our mission of helping everyone learn how to do anything.


...
0 0
9
...
0 0
10

As we all know, SSH is secure shell protocol which is used to securely communicate with other systems on the network. There are many chances that you want to automate tasks, such as synchronization files between two systems, automatic backup between two or more systems using your own scripts. In such cases, the two systems must be login to each other without having to enter the password manually by the user. In this brief guide, we are going to configure passwordless SSH login in Unix-like systems. That means, we don’t need to enter the password when we SSH to other system on the network.

Configure Passwordless SSH Login In Linux

For the purpose of this guide, we will be using two systems running with CentOS and Ubuntu. CentOS is the remote system, and Ubuntu is my local system.

Here is the my local and remote system’s details.

Local host:

OS : Ubuntu 16.04 LTS 64-bit server IP address : 192.168.43.2/24

Remote host:

OS : CentOS 7 64-bit...
0 0
11

Often you will need to move one or more files/folders or copy them to a different location. You can do so using an SSH connection. The commands which you would need to use are mv (short from move) and cp (short from copy).

The mv command syntax looks like this:

By executing the above command you will move (rename) the file original_file to new_name.

You can also use mv to move a whole directory and its content:

This will move all files (and folders) from the includes/ directory to the current working directory.

In some cases however, you will need to only update and move only files that were changed, which you can do by passing -u as argument to the command:

The copy (cp) command works the same way as mv, but instead of moving the files/folders it copies them. For example:

The command will copy the original_file file to new_file and will preserve the original one (the file will NOT be removed after it is copied).

cp also...

0 0
12

I want to be able to fire commands at my instance with gcloud because it handles auth for me. This works well but how do I run them with sudo/root access?

For example I can copy files to my accounts folder:

gcloud compute scp --recurse myinst:/home/me/zzz /test --zone us-east1-b

But I cant copy to /tmp:

gcloud compute scp --recurse /test myinst:/tmp --zone us-east1-b pscp: unable to open directory /tmp/.pki: permission denied 19.32.38.265147.log | 0 kB | 0.4 kB/s | ETA: 00:00:00 | 100% pscp: unable to open /tmp/ks-script-uqygub: permission denied

What is the right way to run “gcloud compute scp” with sudo? Just to be clear, I of course can ssh into the instance and run sudo interactively

Edit: for now im just editing the permissions on the remote...

0 0
13

This document covers the SSH client on the Linux Operating System and other OSes that use OpenSSH. If you use Windows, please read the document SSH Tutorial for Windows If you use Mac OS X or other Unix based system, you should already have OpenSSH installed and can use this document as a reference.

This article is one of the top tutorials covering SSH on the Internet. It was originally written back in 1999 and was completely revised in 2006 to include new and more accurate information. As of October, 2008, it has been read by over 473,600 people and consistently appears at the top of Google's search results for SSH Tutorial and Linux SSH.

What Is SSH?

There are a couple of ways that you can access a shell (command line) remotely on most Linux/Unix systems. One of the older ways is to use the telnet program, which is available on most network capable operating systems. Accessing a shell account through the telnet method though poses a danger in that...

0 0