All Questions
Tagged with environment-variables ssh
46 questions
0
votes
1
answer
105
views
Return multi-line ssh output to separate variables?
RHEL 8.10
OpenSSH_8.0p1, OpenSSL 1.1.1k FIPS 25 Mar 2021
As expected, this line (with two embedded commands) returns two rows:
$ ssh -q remoteserver "ls -1 /proc/${p}/fd | wc -l ; ps -Ostate -p$...
9
votes
1
answer
600
views
Why is bash startup executed under non-interactive ssh
I see an unexplained difference in behavior with ssh on Linux and FreeBSD, and it is the FreeBSD behavior that I would expect from the plain language of the manpages. So, something extra happens on ...
3
votes
1
answer
231
views
Openssh SendEnv+AcceptEnv not working as expected
I want to send some environment variables over ssh. I amended the sshd_config at the server, adding a file in /etc/ssh/sshd_config.d containing:
# NB This DOES NOT conflict with PermitUserEnvironment=...
0
votes
1
answer
70
views
Is there an env var 'SSH_PWD', and how do I use it to restore my last 'pwd' prior to logout?
The lab has several "Raspberry Pi" machines which run a Debian-flavor OS. They are used for specific purposes - which is to say that after I make an SSH connection, I cd to the folder where &...
0
votes
1
answer
1k
views
Why am I missing $XDG_RUNTIME_DIR and $DBUS_SESSION_BUS_ADDRESS after logging in via SSH and trying to set up user scope service
I'm trying to set up a user scope service after logging in via SSH, but when I try setting anything up like..
systemctl --user enable wallpaper.timer
I get these errors, even though I'm logged in via ...
0
votes
5
answers
1k
views
How to start ssh-agent without eval
What I already know
To start ssh-agent you need to use the command eval $(ssh-agent)
You have to do this because of security reasons. A child process can't change environment variables of the process ...
1
vote
1
answer
292
views
variable via SSH session
mount.cifs can use the variable PASSWD for password authentication.
Well, the following example show the problem:
export PASSWD=mysecret; ssh foreignhost "echo $PASSWD"
works, it means, the ...
2
votes
2
answers
2k
views
How to take a screenshot over SSH?
I have an Ubuntu Desktop machine. My scope is to take a screenshot of this machine via SSH. This machine is playing a video, and I would like to take a screenshot of this video via SSH.
I've tried as ...
1
vote
1
answer
845
views
Why does the GitHub actions ssh login not set my environment variable?
When I login using ssh command to remote server Linux VM-0-16-centos 3.10.0-1160.31.1.el7.x86_64 #1 SMP Thu Jun 10 13:32:12 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux and execute env command, I can find ...
0
votes
1
answer
148
views
Setting environmental variable in linux via ssh
I am working on three different issues so I have cloned source code in three different directories.
1) /nobackup/vivek/dev1/<source_code>..
2) /nobackup/vivek/dev2/<source_code>..
3) /...
0
votes
2
answers
96
views
How do you reference env vars from the remote machine when running ssh command locally?
I want to execute a command on a remote server (Cent OS 7) and use the environment variables defined on that server. However, when I run this command
ssh [email protected] "PGPASSWORD=$...
4
votes
1
answer
3k
views
ssh: force different shell for non-interactive command execution
how can I force specific shell to be used for non-interactive command execution via ssh on remote server?
My default shell on the remote server is zsh, but I need to execute given command using /bin/...
1
vote
2
answers
540
views
This command: ". .bashrc" has resulted in: “-bash: /usr/bin/whoami: Argument list too long” whenever I try to execute any command
While following instructions at a forum post to install something over ssh at an external machine, I executed the following command without thinking:
. .bashrc
I have never seen the command before ...
3
votes
2
answers
2k
views
How to define variable globally
I've setup ssh-agent as a systemd service on my Manjaro (following directions from here). Along with the service itself, the SSH_AUTH_SOCK environment variable needs to be set to ${XDG_RUNTIME_DIR}/...
0
votes
2
answers
484
views
I sourced my .bashrc file and now get: “-bash: /usr/bin/whoami: Argument list too long” so that I can't execute any commands. Using ssh
I use an external HPC system via ssh. Today I tried to install "ASE" a Python code for dealing with atoms. I followed instructions to modify my .bashrc file but kept getting ...