Software :: Reuse One Ssh Connection In A Shell Script?

Mar 4, 2010

I'm writing a shell script that does multiple scp's and ssh'es to the same host. I would like to know if there is a way to write the script such that in the beginning an ssh connection is established. Then scp transfers files over the already open ssh connection. After which, terminal commands are executed on the host. A final scp transfers files again over the ssh connection. Then the ssh connection is terminated.The whole point is *not* to have:

#!/bin/sh
scp the_file host
ssh host 'execute-some-command.sh'

[code]...

View 8 Replies


ADVERTISEMENT

Server :: 522 SSL Connection Failed - Session Reuse Required

Jan 21, 2009

I have a problem with vsftpd (latest version available, 2.1.0pre3) SSL. I've configured it to a nonstandard port, 65440, disabled connect_from_port_20 and run it as a normal user, from home directory. I can't use the SSL feature, every time I connect, it only reaches the login process. After logging in, I get the following error (when data transfer would start for LIST command):

522 SSL connection failed; session reuse required
My vsftpd.conf looks like this

Code:
local_enable=NO
write_enable=YES
secure_email_list_enable=YES
email_password_file=/home/stringz/vsftpd/logins

# local_umask=022
dirmessage_enable=NO
vsftpd_log_file=/dev/null
xferlog_file=/dev/null
xferlog_enable=NO

connect_from_port_20=NO
idle_session_timeout=3600
data_connection_timeout=120
run_as_launching_user=YES

anonymous_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
anon_upload_enable=YES
anon_world_readable_only=NO

async_abor_enable=YES
ascii_upload_enable=YES
ascii_download_enable=YES
ftpd_banner=Welcome!

# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
# chroot_list_enable=YES
# (default follows)
# chroot_list_file=/etc/vsftpd.chroot_list

ls_recurse_enable=NO
listen=YES
listen_address=<myipaddress>
listen_port=65440
listen_ipv6=NO

pasv_enable=YES
pasv_min_port=65441
pasv_max_port=65480
# chroot_local_user=YES

ssl_enable=YES
allow_anon_ssl=YES
force_local_data_ssl=NO
force_local_logins_ssl=YES
ssl_tlsv1=YES
ssl_sslv2=NO
ssl_sslv3=NO
rsa_cert_file=/home/stringz/vsftpd/vsftpd.pem

The client side is a Total Commander 7.02, there hasn't been any problem with its SSL yet and this only occurs when trying to connect to my vsftpd.

View 8 Replies View Related

Programming :: Reuse Socket Fails "Address Already In Use" Or "Connection Refused"?

May 14, 2010

Problem: can't restart programs which use socket to communicate.

Symptom: Restart Listener dies "Address already in use".
Restart Caller dies "connection refused"
System: Ubuntu 10 (and 9)

[code]...

View 3 Replies View Related

General :: How To ReUse Ubuntu APT

Feb 1, 2010

When we use ubuntu apt-get,the first process is downloading the required files into a temporary folder/var/cache/apt/archives.Installation will be done only after thatCan we able to migrate these files into a different system so that we can install those applications without using internet.

View 3 Replies View Related

Slackware :: How To Reuse A Kernel

Oct 13, 2010

I've just upgraded my slackware 13.1 box to the latest stable kernel. Really impressed by the improvement on boot time and graphic card driver for my old Intel chipset. So I intend to use this newly built kernel to another computer of mine, which is running slackware 13.1 too. I want to keep this computer as clean as possible by installing no build tools, experimenting stuff, etc..., just binary packages for a neat, minimal box. So I'm thinking of copy the new kernel files (System.map, vmlinuz, config) to /boot as directed here in the slackbook.

But as I also notice that there are new files installed under /lib/modules/linux-2.6.35.7 (the new kernel), I'm afraid that I'm missing some other files of the kernel installed somewhere in the system. So are these files all the components of the new kernel, or do I need to look at some other places to grab the whole cake?

View 3 Replies View Related

Ubuntu :: Reuse System Install CD?

Feb 8, 2010

I know this sounds like a noob question. But can you use a linux install cd multiple times? Like could I use one CD to install Linux on multiple computers? Also, is it better to burn the image at a slow rat, or does it not matter?

View 9 Replies View Related

Ubuntu Installation :: Backup Apt Archive For Reuse After Clean Install?

Apr 13, 2010

I do several things, involving a lot of different software (coding, image manipulation, drawing, video editing, etc).And where I live, internet is utterly slow, so instead of actually benefiting of the quick Ubuntu install, I am doomed to spend countless days re-downloading my packages each time.Before my last format, having gained a slightly greater understanding of how Linux works, I saved all the content of apt archives, so synaptic would pick the packages already downloaded from there.But it does not! It re-downloads every package.What should I do to have synaptic recognize packages that are already there?

Note: I am NOT looking to create a mirror repository, aptOnCd and whatnot. I also DO NOT want to install packages by hand, one by one or all together.All these solutions are certainly valuable (and I've tried a good bunch of them), but then I have to update manually my mirrored repository and/or install updates manually. Furthermore, it leaves me with two directories with packages, apt archive and ~/my-repository, which is just messy (in my view at least).

View 2 Replies View Related

Fedora Installation :: Reuse The /home Partition On Multi-boot Systems?

May 5, 2009

Having already borked my system once while deciding to nstall Fedora 10 under the influence of a false sense of bravado, alcohol induced, I thought I should ask for a little insight before trying things again. Once I get my system fixed and before consuming alcohol that is.Short version:I thought Id be smart and mount the /home partition I use for openSUSE as /home for Fedora, I mean that why I made /home it own partition right? Well, thatwhen the alcohol took over and I thought I be rilliant(not so much) and just use my SUSE username for Fedora too, since, you know,e already got all my files and settings stored there.

Thus my request for the answer on how to correctly use the same /home partition across multiple OS installations; with the preferred goal of retaining access to email folders, various files, games (WINE) and such no matter what distro I�m using. Would it really be as simple as just not using the same user name for more than one distro? What addtional issues does that solve/create

View 3 Replies View Related

Ubuntu :: WUBI - Reinstalled Windows - Partition Is Intact Can Reuse It Without Loss

Jun 10, 2010

I installed ubuntu under windows. i reinstalled windows, though the linux partition is intact. howcan i reuse them without losing data ?

View 1 Replies View Related

Ubuntu Servers :: Allow A Ssh Connection For Tunneling But No Shell?

Oct 7, 2010

I need to allow connection to some users on a servers with key authentication so that they can setup a tunnel to access a web application. But I don't wan't them to have a access to a shell.

View 5 Replies View Related

Ubuntu Networking :: Configure Vpn Connection Using Pptp From The Shell

Feb 11, 2010

I tried to configure my vpn connection using pptp from the shell following following tutorial: [URL] now, if i use Code: pppd call novax to connect to my vpn i see following appearing in /var/log/messages:

Code:
Feb 10 21:11:57 reg-laptop pppd[2655]: pppd 2.4.5 started by root, uid 0
Feb 10 21:11:57 reg-laptop pppd[2655]: Using interface ppp0
Feb 10 21:11:57 reg-laptop pppd[2655]: Connect: ppp0 <--> /dev/pts/0
Feb 10 21:11:58 reg-laptop pppd[2655]: CHAP authentication succeeded
Feb 10 21:11:59 reg-laptop pppd[2655]: MPPE 128-bit stateless compression enabled
Feb 10 21:12:00 reg-laptop pppd[2655]: local IP address 10.243.249.22
Feb 10 21:12:00 reg-laptop pppd[2655]: remote IP address 10.243.249.20

verifying with ifconfig, my ppp0 ip is correctly set to 10.243.249.22 - i can also ping this ip but i tried to ping other ips in our network and i can't reach any of them - did i mess up the route maybe? Content of my /etc/ppp/ip-up.d/route-traffic:

[Code]...

View 1 Replies View Related

Programming :: Creating Script For Mysql Connection From Shell?

Jul 8, 2011

I'm creating script to connect to mysql and perform function. I'm into process in querying mysql from shell. Here is the content of a sample script:

Code:
#!/bin/bash
USER=scripter
PASS=test123
DB=test_scripts

View 2 Replies View Related

Networking :: Shell Script Should Switch If Connection Established But Doesn't?

Jan 18, 2010

I have created the following script

Code:
#!/bin/sh
interface=`ifconfig | grep -iE "(wlan0|gprs0)" | awk '{print $1}'`

[code]...

View 14 Replies View Related

Debian Configuration :: Saving Configuration And Packagelist For Reuse?

Nov 14, 2010

I have problems with the system harddrive. I would like to install my Debian on to a new HDD with the same configuration and packages. How do I get the configuration to the new Debian. What files/directory do I need to copy? How do install the same packages?

View 4 Replies View Related

General :: $HOME/.bashrc Disabled When User Shell Is 'rbash' (restricted Shell)?

Jun 15, 2011

MACHINE: HP Proliant DL260G5OS: SLES 11 SP1kernel: Linux xserver 2.6.32.12-0.7-default #1 SMP 2010-05-20 11:14:20 +0200 x86_64 x86_64 x86_64 GNU/LinuxIt is used as remote xserver in a LAN.I have configured /usr/lib/restricted/bin/.rbashrc with some environment variables but when the users logon in the system finally is executed $HOME/.bashrc and some environment vars are overwritten.

View 2 Replies View Related

Fedora :: Stuck With Bash Shell / Changing Default Shell To Tcsh?

Mar 14, 2010

I want to change my default shell to tcsh. I used

Code:
usermod -s /bin/tcsh username
command as given at url

But if I open a new shell, it is still a bash shell.

How do I make my default shell as tcsh?

View 6 Replies View Related

Ubuntu :: Using 10.04-server 64bit AMD With Fluxbox - Matlab In A Shell The Shell Does Not Display Characters Anymore

Jul 26, 2010

I am using ubuntu10.04-server 64bit AMD with fluxbox. After I ran Matlab in a shell (without GUI) the shell does not display characters anymore, but will execute any command, I just can't see the characters that I'm typing.. I use aterm and xterm, does anybody know why that is, am I missing a package?

View 1 Replies View Related

Ubuntu :: Switch Desktop Shell From Unity To Gnome-shell?

Apr 14, 2011

Is there any way I can switch my desktop shell from unity to, say, gnome-shell? I can switch using other console shell I like (bash, csh, fish, etc.). Assume that there is a stable alternative desktop shell, I should be able to choose, too.

(For console shell, we goes to /etc/passwd. But for desktop, I can't find the way to config.)

View 2 Replies View Related

Software :: Export A Variable To Parent Shell In Shell Scripting?

May 21, 2009

Is there a way to export a variable to parent shell in shell scripting ?

View 3 Replies View Related

Programming :: Shell Scripting / Create A Shell Script Similar To Ls?

Jun 5, 2011

I am trying to create a shell script similar to ls, but which only lists directories. I have the first half working (no argument version), but trying to make it accept an argument, I am failing. My logic is sound I think, but I'm missing something on the syntax.

Code:
if [ $# -eq 0 ] ; then
d=`pwd`
for i in * ; do
if test -d $d/$i ; then
echo "$i:"
code....

View 10 Replies View Related

General :: Write A Shell Script Instead Of Shell Function?

Apr 27, 2011

I would like know when it is necessary or advisable to write a shell script instead of shell function ?

View 3 Replies View Related

Programming :: Bash-shell-like Less Functionality In The Python Shell?

Jun 25, 2010

Is there some type of functional way to read things in the Python shell interpreter similar to less or more in the bash (and other) command line shells?

Example:

Code:

>>> import subprocess
>>> help(subprocess)
...
[pages of stuff to read]
...

I'm hoping so as I hate scrolling and love how less works with simple keystrokes for page-up/page-down/searching etc.

View 4 Replies View Related

General :: Open A New Shell From A Shell And Switch Between Them?

Jan 18, 2011

I am wondering if I can open a shell or new terminal thing from within the terminal in a unix/linux enviroment. Particularly a commandline only one where there is no GUI. Is this doable? how do I do it?

View 3 Replies View Related

Programming :: Prevent "leak" Into Shell From A Customized Shell Menu Script?

Dec 15, 2009

I've created a simple script based menu. This menu will be accessed by only a certain users via ssh.When user logs in, the menu will automatically run. (configured at user's .bash_profile).How do I force the session to close when user hits Ctrl-C or Ctrl-Break ?In a nutshell, I don't want user to have access to shell.

View 11 Replies View Related

Server :: Add To The Shell Script That Will Allow To Generate The File Using The Shell Script?

Jan 24, 2010

Quote:

/usr/local/bin/mencoder /root/video1.avi -of lavf -ovc lavc -lavcopts vcodec=flv:vbitrate=300:acodec=libfaac:abitrate=64 -srate 22050 -oac lavc -vf scale=360:240 -o /root/output_temp_video1.flv

[code]....

View 2 Replies View Related

Networking :: Shows Connection But Not Connected / "connection Information" Shows A Varying Percentage Of Connection?

May 26, 2010

I have just installed ubuntu 10 on a thinkpad t410. At first everything worked swimmingly, INCLUDING the wireless. After about five minutes, the wireless stopped working, in that it seemed to think it was still connected but pinging didn't work. I've now restarted several times, and each time I restart, the wireless works for about 1 minute, then stops working. If I try to disconnect and reconnect it will not reconnect (until I restart, that is).

iwconfig shows the correct ESSID and ifconfig shows an address, and "connection information" shows a varying percentage of connection.

View 1 Replies View Related

Programming :: How To Turn Non-interactive Shell Into Interactive Shell?

Feb 4, 2011

I have a situation where I am in a non-interactive shell. I have tried from within my non-interative shell to spawn an interactive shell but my output still does not goto me. Isn't there a way I can somehow go into /proc or somwhere and make the output my /dev/tty1? Or some way else to remedy this?The situation arises because I drop from my restricted shell environment (a sort of CLI interface), into the actual Linux shell. I cannot change the code of the CLI environment I am just faced with being in the linux shell environment and its non-interactive. Its very annoying to have to put > /dev/tty1 after every command I type.

Not to mention it seems damn near impossible to get pagers like more and less to work properly when your in a non-interactive shell.

View 2 Replies View Related

OpenSUSE Hardware :: Setup Multipath With Failover Policy On 11 - Connection Failed Over To Second HBA Connection To SAN

Aug 13, 2009

I am trying to setup multipath with failover policy on openSuSE 11. I have two qla2xxx HBA's installed and they appear to be working. Here is the output of "multipath -l" command

[Code]....

While testing, I pulled one of the two connection to SAN, and the connection failed over to second HBA connection to SAN. When I plug the cable back in, it does not fall back to original connection... It stays in failed state. Also, I noticed that failed disk (sdd disk) comes back as (sdg disk), which is probably why connection does not fall back to original HBA. But, when I run "/sbin/service multipathd restart" sdg disk shows as as enabled in multipath -l...

View 9 Replies View Related

Ubuntu Multimedia :: PulseAudio Volume Control - Connection Failed:Connection Refused

Jul 4, 2010

I tried to finally set-up surround sound on my Ubuntu 10.04 machine and i was successful in doing so after a while of changing settings and tinkering. After doing so though, i was later in the day not able to get into the Pulseaudio Volume Control, therefore, everything is stuck where it is and i can't change anything. When i try to open Pulseaudio Volume Control i get the error message, Connection failed, Connection refused. My programs still play sound and i can control the sound of the programs through the programs, but i cant control the sound of the sorround sound now and my main sound bar only affects my stereo speakers, not the surround ones.

I believe this may have happened after the random disk check on restart, but i can't 100% confirm that and i'm not even sure if they are related. I still have sound, but i have no way to control the volume of my entire system at once. I did some looking around online and saw that others are having or had the same issue, and it was through different versions of Linux also. somehow reset everything so i can access PAVC and start over . I also tried steps listed in another thread here on the same topic, but they weren't working and it also seemed to be for older Ubuntu versions.

[Code]....

View 9 Replies View Related

Ubuntu Networking :: Setting Up Bluetooth Connection Between Two Computers Throws Connection Refused (111)

Apr 3, 2011

I'm trying to create a PAN (Personal Area Network) using a laptop (Siragon ML-1040) and my desktop computer, but I get the Connection Refused (111) error.

Blueman doesn't detect any network service between the two computers unless I start PAND on one of them and then it detects the NAP service. That, only after I enable the NAP/Workgroup services on the Services submenu in Blueman. However, it doesn't work neither with the NM plugins or without them (dhclient and that other one I can't remember the name of).

Any clues over here? I'm using pand 4.91 and blueman.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved