SSH access parent host folder - linux

After connecting to a remote server (A) through ssh is it possible to access host's folder/files?
This server A has access to another server (B) which I can't access from my computer. I need to run some commands on B using some config files on my computer.

I ended up copying the files from my computer to A using scp and run the commands there.

Related

Backup files and folders from remote host using Rsync Nodejs

I want to create a backup script using nodejs, cronjob. I use npm rsync to make copies of my files and folders. The code works inside the local driver, but I can't connect to the source remote host:
rsync = new Rsync()
.flags("e")
.source("192.168.1.140:/home/test/YDA")
.destination("../Desktop/fff/");
How I could provide username and password for the remote host?

access to client -machine directories while logged-in as ssh

im logged into server by ssh from macOs terminal username_on_server#server_linux:/$ but i couldnt come inside the mac client (while im logging as server user), to change directory or smthing inside client machine to send to server machine
e.g. I need to copy some file or directory from client to server as ssh but any changing directory refers to server
my-mac:~ newuser$ ssh 'username_on_server#server_linux'
username_on_server#server_linux:/home$ pwd
/home
Once you are logged into server_linux you cannot change/modify the client machine, basically the SSH connection is like if you were in the remote server. If you want to copy a file from client to server use instead scp
scp client_file username_on_server#server_linux:/server_path

Connecting to Perforce Personal Server on Lan

I have created a Personal Server using the P4V "Helix Client" on my Windows 10 workstation at home.
I would like to be able to connect to this server from my laptop on the LAN so that I can pull from it. (To make sure that everything that is required for the project is correctly in the repository, and testing)
Should I be able to connect to this server using the workstations IP address and port 1666?
Is there an additional step I need to take to "serve" the repository?
A "personal server" doesn't listen on the network by default (the client spawns a short-lived server process in place each time it runs a command).
To convert your personal server into a shared server, install the Perforce service (this'll be part of the server installer on Windows) and set its server root directory to match the path you gave your personal server.
Alternatively, you can go to a command prompt and run:
p4d -r Z:\Core\.p4root -p 1666
but that server will only be up and listening for as long as that command prompt is open, whereas the service (p4s.exe) will run in the background.
We need to provide "localhost:1666" as the server which means that (the same as the IP address 127.0.0.1). It will only work for you and not other machines.
Open the tab "Initialize New Personel Server" Tab and then specify your server location.

How can we add an application to startup remotely (Linux)

I have an application which executes on a remote Linux system. How can I add this application to startup of that remote system from my local linux system. I know the path of executable (application) on remote system.
I searched a lot on different sources but didnt get any idea ?
Edit: What am I doing is:
I have developed a desktop-application (using qt).
I have loaded this application on remote system (using libssh).
I am able to execute this application remotely.
Now, I want to add this application to startup of that system remotely (stucked here).
Any Idea how to complete 4th step ??
Create Executable.desktop file (on local machine)
Open ssh connection and get remote machine root access
Copy this Executable.desktop file to "etc/xdg/autostart" on remote system (using ssh and commonds )
Reboot the remote system (using ssh and commonds )
Note: The solution will work if we know the location of executable/application on remote system

Using SCP command to download files from Linux server to client server

I'm creating files on a Linux server that I'm logged into and I'm adding the ability for the user to download these files from the Linux server on to the connecting computer. I'm writing a scrip and using the scp command to download these files:
scp data.txt user#usraddress:/home/usr
However, I don't want to specify "user#usraddress:/home/usr" to be just my computer. I want whoever is logged onto the linux server to be able do download these files. Is there a way to get the address of the connecting computer?
How would I do this?
Forgive me if this seems elementary, I'm very new to scripting.
When you open a remote session in a GNU/Linux machine, the ssh server sets the environment variable SSH_CONNECTION with some connection information. You can use this variable and the $USER variable to fill that parameters:
scp data.txt $USER#${SSH_CONNECTION%% *}:/home/$USER
Note that as far as I know you couldn't assume the client home directory is at /home. As said by chepner, you could omit the destination directory to use the default location, the home directory.
scp data.txt $USER#${SSH_CONNECTION%% *}:

Resources