Hi,
I am new to unix. Is their a way to pass the output of the line below to a variable var1.
ls -1t | head -1.
I am trying something like var1=ls -1t | head -1, but I get error.
Situation is: I get file everyday through FTP in my unix box. I have to write a script that picks up first... (1 Reply)
Dear All,
Can anybody explain me how to pass the variable value to command argument which will execute in remote machine.
example..
test="test-123.dbf"
how can i pass this value to command ls -l for remote machine?
I tried to do like this way
ssh root@remote 'ls -l... (2 Replies)
i have a bash script on serverA, when i run the script on the server, it runs fine. the way to run the script is like this ./script "option1"
Now i am trying to call it from local laptop using ssh command, my command is as the following
ssh serverA ~/script "option1"
and i got error... (7 Replies)
Hi,
My script will take 3 i/p's from user. Now i need to pass these 3 values to remote server. Please find my code.
while
do
echo " To which server you want to connect ? "
echo " 1. server1 \n"
echo " 2. server2 \n"
read opt_server
if
then
echo "enter the... (2 Replies)
I am running a useradd script, which works locally but I want to take some of that local information and send it to a remote system, ssh keys are set up between the two systems. I am attaching the script, look at the section titled
"Sending information to FTP2"
Removed attachment, added... (0 Replies)
Hi, I've an issue in a shell script:
I'm opening an ssh connection to a remote server, then I want to store the result of a ls command in a variable, but it doesn't work: the ls is done on the local machine.
ssh user@server << EOF
ls # works as expected (ls is done remotely)
test=`ls` # the... (1 Reply)
Hi Guys n Girls,
Below im using a while command to wait for a file on another server then carrying on with the script.....
I dont believe the $Sausage1 variable is being passed to the other server so its not finding the file. If i replace the variable with the date then it works as expected.
... (2 Replies)
john-test:/root> ssh -q chicago-ser uname;date
Linux
Fri Oct 13 16:41:11 GMT 2017
How I can print on the same line like this :
Linux Fri Oct 13 16:41:11 GMT 2017 (2 Replies)
If I am running a bash command, and some awk getting the ethernet adapter on the local machine. It works fine. But if I will run it from the remote, it is EMPTY on echo and throwing error in grep.
Thank you
This work perfectly fine
$ f=`/sbin/ip a|grep 127.127 | awk '{print $NF }' ` ; ip... (2 Replies)
Hi,
I have a working script.
It does what I am intending it to but a bit confused whether the sed part is supposed to be working or not. Further down is the script with the sed part that should have been working but not and the grep -v part which is the workaround that I am using at the... (10 Replies)
Discussion started by: newbie_01
10 Replies
LEARN ABOUT LINUX
ssh-socks5-proxy-connect
ssh-socks5-proxy-connect(1) User Commands ssh-socks5-proxy-connect(1)NAME
ssh-socks5-proxy-connect - Secure Shell proxy for SOCKS5
SYNOPSIS
/usr/lib/ssh/ssh-socks5-proxy-connect [-h socks5_proxy_host] [-p socks5_proxy_port] connect_host connect_port
DESCRIPTION
A proxy command for ssh(1) that uses SOCKS5 (RFC 1928). Typical use is where connections external to a network are only allowed via a socks
gateway server.
This proxy command does not provide any of the SOCKS5 authentication mechanisms defined in RFC 1928. Only anonymous connections are possi-
ble.
OPTIONS
The following options are supported:
-h socks5_proxy_host Specifies the proxy web server through which to connect. Overrides the SOCKS5_SERVER environment variable.
-p socks5_proxy_port Specifies the port on which the proxy web server runs. If not specified, port 80 is assumed. Overrides the
SOCKS5_PORT environment variable.
OPERANDS
The following operands are supported:
socks5_proxy_host The host name or IP address (IPv4 or IPv6) of the proxy.
socks5_proxy_port The numeric port number to connect to on socks5_proxy_host.
connect_host The name of the remote host to which the socks gateway is to connect you.
connect_port The numeric port number of the socks gateway to connect you to on connect_host.
EXAMPLES
The recommended way to use a proxy connection command is to configure the ProxyCommand in ssh_config(4) (see Example 1 and Example 2).
Example 3 shows how the proxy command can be specified on the command line when running ssh(1).
Example 1: Setting the proxy from the environment
The following example uses ssh-socks5-proxy-connect in ssh_config(4) when the proxy is set from the environment:
Host playtime.foo.com
ProxyCommand /usr/lib/ssh/ssh-socks5-proxy-connect
playtime.foo.com 22
Example 2: Overriding proxy environment variables
The following example uses ssh-socks5-proxy-connect in ssh_config(4) to override (or if not set) proxy environment variables:
Host playtime.foo.com
ProxyCommand /usr/lib/ssh/ssh-socks5-proxy-connect -h socks-gw
-p 1080 playtime.foo.com 22
Example 3: Using the command line
The following example uses ssh-socks5-proxy-connect from the ssh(1) command line:
example$ ssh -o'ProxyCommand=/usr/lib/ssh/ssh-socks5-proxy-connect
-h socks-gw -p 1080 playtime.foo.com 22' playtime.foo.com
ENVIRONMENT VARIABLES
SOCKS5_SERVER Takes socks5_proxy_host operand to specify the default proxy host.
SOCKS5_PORT Takes socks5_proxy_port operand to specify the default proxy port.
EXIT STATUS
The following exit values are returned:
0 Successful completion.
1 An error occurred.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWsshu |
+-----------------------------+-----------------------------+
|Interface Stability |Stable |
+-----------------------------+-----------------------------+
SEE ALSO ssh(1), ssh-http-proxy-connect(1), ssh_config(4), attributes(5)SunOS 5.10 30 Oct 2002 ssh-socks5-proxy-connect(1)