CentOS 5 :: Bash Script Command For Auto Login On Several Hosts

Nov 2, 2010

I am trying to make a bash-script for auto-logins on several hosts, seems there is a problem with the quotes and I can't figure it out. I've experimented with singles and doubles but no luck yet. Below are two variants with respective outputs. In both cases the output of echo works fine if I copy and paste it to a prompt, but when executed from the script it falls down.

* Only one case-clause for testing...
* Not possible to use passwordless key-login

#!/bin/bash
PASSWORD="my_password"
case "$1" in
"example1" ) HOST="example-host-1"
echo $HOST;;
esac
if [ $HOST ]
then
COMMAND="expect -c 'spawn ssh $HOST ; expect assword ; send $PASSWORD
; interact'"
echo $COMMAND
exec $COMMAND
else
echo "No host argument"
fi

View 7 Replies


ADVERTISEMENT

General :: Auto Start Bash Script After Login To Desktop?

Mar 26, 2010

I am using Fedora and trying to auto run a script soon after the unit boots to desktop. I found many suggestions and finally decided to use the Sessions->Startup Programs option (under System->Preferences->Personal->Sessions menu). I added my script in the Startup Programs with the command 'sh myscript.sh'. Now I have two questions here:1. When I use the command 'gnome-terminal -e myscript.sh', I get 'There was an error creating the child process for this terminal' message after logging into the desktop. Can any one tell if I am missing something here?2. Even if I use sh instead of gnome-terminal, I still want to see the script executing. In other words, my script has certain echo statements indicating the flow of the script. But I don't see any shell opening up with these echo statements showing up, after the unit boots to desktop. But the script was still executed with no problem

View 1 Replies View Related

SUSE :: Disable Opensuse Auto Login From Command Line?

Mar 2, 2010

I have installed opensuse on VirutalBox , during installation I said "yes" to autologin as normal user.After installation and restart , it shows follwing message "Logging in Laks ...Cannot enter home directory . using /"I can login as single user by passing "single " in grub.

View 9 Replies View Related

Networking :: Auto Detect Hosts With Nagios

Feb 17, 2011

Is it possible to configure nagios to auto detect all the hosts that belong to a network and place them in the cfg files?

View 1 Replies View Related

Ubuntu Security :: Ecryptfs Doesn't Auto-decrypt With Auto-login

Jan 6, 2011

I recently installed 32bit maverick and wanted to make it login automatically. I tried enabling auto login from Admin > Login but that didnt work and I was still prompted for my password. Then I went to Users & Groups and changed the password option to Do Not ask for password at login now after I reboot, the user list is shown (only 1 user) and it doesnt ask for password after I click on my username.

However, then it gives a few errors (as i vaguely recall):

1. cannot load .ICE directory in my home directory
2. some error 256 about a gconf-sanity-2 file
3. nautilus cannot load my home directory etc

and then it gets stuck without loading anything (blank wallpaper). i ve tried navigating to my home directory using Alt F2, gksudo nautilus and my home dir contents are encrypted by the ecryptfs (there is a readme.txt file and a shortcut). i have tried to decrypt but it doesnt work... i ve also tried to start/stop gdm, and startx but nothing works. if i stop gdm, then the prompt doesnt recognize my password and keeps on rejecting the commands i enter... I think this has something to do with the home dir not being decrypted due to the dont ask for paswd option... how can i disable the dont ask for pwd without the gui (i can access my / by booting through an external usb).

View 4 Replies View Related

Debian Configuration :: Auto-login And Auto-connect To Networks

Jun 3, 2010

I press On-button, Debian boots, logs in and automatically connects to the Wireless network AND! to my local pc via LAN. It runs an ssh server, so I can ssh into debian over internet and communicate with the local pc (send a magic packet).Here are my problems:

1) I don't how to log in automatically. This and this doesn't work.
2) I need a network tool that can manage multiple connections and has a reconnect feature. With the default network manager I cannot even connect to more than one network simultaneously although I have two network devices of course.

And I guess I can run all that in console mode, right?

View 10 Replies View Related

General :: Login Command In CentOS ?

Aug 13, 2010

For some reason every time I enter the 'login' command as root, my putty shell craps out. It's as if the kernel is not prepared or does not know how to handle the 'login' command. Where can I set it up? Maybe it's not configured to use PAM?

I want to use this command to switch users. Sure I can use 'su username' but I noticed there are some issues when using 'mail' command right after I change users. It gives me a permissions error as if the environment variable for mail is set for roots mailbox instead of the new users mailbox.

How can I configure 'login' to work properly in CentOS?

View 2 Replies View Related

CentOS 5 :: Software RAID Auto Sensing Auto Rebuild Possible?

Jul 23, 2010

I recently installed a server with Software RAID. I tested by powering it down, unplugging one drive and powering it up. Magically, it worked!I found out later that I have to manually add individual devices like md1 to sda2 md2 to sda4. I got all of them added and rebuilt but my question is: Is there a way to make it so that if I "removed" a drive and put it back, the system will senses the new drive and rebuilds based on some internal table?

View 1 Replies View Related

CentOS 5 Server :: Hosts File And Resolv.conf Conflict CentOS 5.5?

Apr 11, 2011

I am running an application that requires use of my /etc/hosts file. In it, I have my machine name and its LAN ip address. The program creates a service on a specific port, then attempts to connect to it based on the host name. So my hosts file has to be correct.I added the nameservers to resolv.conf and now my application will not run. My guess is that the computer is checking the name servers first, timing out then checking the hosts file.Is there a way I can tell the system to check the hosts file first, then DNS. I thought it should behave that way by default, but it does not appear to.

View 1 Replies View Related

Ubuntu :: Run Application Before Gdm (login Screen Or Auto Login)

Feb 22, 2010

I have program that work like Fedora Firstboot it's run only one time after finish installation. I have two questions to ask.

1. How can I start this application before gdm start (login screen or auto login)

2. How can I start this application in fix display resolution (800x600)

My method now is

(This is a part of script , this script execute from /etc/init.d/myfirstboot , I create symlink to /etc/rc2.d/S1myfirstboot for start it before anything)

gdm-stop # first time I use /etc/init.d/gdm stop
DISPLAY=:1
export DISPLAY
/usr/bin/Xorg :1 &

[Code]...

I don't understand why first time firstboot start the system will auto loging in but not complete yet and then my script is start and it's work does not fine I think that is another user is already login , but if I re run my firstboot again and again (by setting something that can revoke my firstboot and restart) it's work before auto login and every things is ok!

View 3 Replies View Related

Ubuntu Servers :: X0.hosts Ignored And Also Ssh Login With X Apps?

Feb 8, 2011

I have just downloaded and installed the 32 bit server version on a couple of machines.These machines are remote displays, no keyboards or mice, requiring a kick of from ssh to start the app. Its just bare sever install with TWM, X, and XDM.Problem is they don't seem to read my /etc/X0.hosts file until theres been a keyboard login. After that locally xhost returns the names from the file.I removed the exec /usr/bin/X -nolisten tcp "$@" linefrom /etc/X11/xinit/xserverrc but this also isIn the user .profile I have these 2 lines, DISPLAY='0.0'xhost +This is a real chicken and egg thing, no auto login, no keyboard for login and no ssh X access before a local login. And no easy way to make it auto login with out installing GWM.

View 1 Replies View Related

Programming :: Bash/Perl Script - Provide List Of Hosts To Choose From And Ssh To Chosen Host?

Apr 6, 2010

I'm not sure if this is best done in Perl or Bash. I'm thinking surely someone else has created something close to what I'm looking for. The results of the script would be that someone would kick off "linux_hosts.sh" r whatever you want to call it, then a top "folder" of options (with hosts contained within each of these top menu choices), then, based on which number corresponds to that top level, they're presented with a set of linux hosts that are relevant to that top level name. Example:

$ linux_hosts.sh
1. VMware hosts 4. Private Domain
2. ESX servers 5. Red Hat boxes

[code]...

View 4 Replies View Related

Programming :: Ssh Command On Multiple Hosts?

Apr 13, 2010

I want to create a script to insert the fstab and hostname in a textfile of multiple servers on the network without a password. The servers are situated in a text file. So i want to read the text file line by line and write the output into another textfile.

View 10 Replies View Related

Software :: Can't Install Skype On CentOS 5 - Bash: Skype: Command Not Found

Oct 23, 2010

I've read and execute the info write in this guide :

[URL]

When I type skype , I receive this message :

bash: skype: command not found.

View 4 Replies View Related

General :: Write A Literal Bash Command In A Bash File?

Nov 29, 2010

I create a bash script that writes another bash file. But in the generated bash file I want to write a bash command in the file and not executing it.Here's my bash file:

Code:
#!/bin/bash
cat > ~/generateGridmix2data.sh << END

[code]...

View 6 Replies View Related

Ubuntu :: Terminal Bash / -bash: Ls: Command Not Found

Jun 5, 2011

I got a problem with terminal, since i'm really a noob with terminal i don't know how to fix it.Everytime i type in a command it shows for example:

-bash: ls: command not found

Even the basic commands don't work... just cd <directory> and those things works

View 9 Replies View Related

Security :: Invalid Login Attempts Not Refused Using Deny Hosts And Conf Of Denyhost Not Working?

Oct 28, 2010

I am using denyhosts on a server so in a config file/etc/denyhosts.confthe following value is setQuote:DENY_THRESHOLD_INVALID = 3which as per their configuration file saysQuote:

DENY_THRESHOLD_INVALID: block each host after the number of failed login
# attempts has exceeded this value. This value applies to invalid
# user login attempts (eg. non-existent user accounts)

[code]...

View 1 Replies View Related

General :: Host Command And Web Browser's Don't Accept Hosts.conf Order

Mar 4, 2011

Why does ping see audit.median.hu as 127.0.0.0, and why does host -t a audit.median.hu see it as 193.68.35.149? audit.median.hu is just an example site [hosts ads, etc.]

I just have a caching nameserver on my Fedora PC:

I configured my DNS server addresses in the Network-Manager Applet: 127.0.0.1, 8.8.8.8

Even with Wireshark, I can see it:

So the big question: Why don't the host command or my web browser recognize that I have modified audit.median.hus IP address?

View 1 Replies View Related

Security :: Use Current /etc/hosts File To Do An Ssh-keyscan Instead Of Making A Special List Of Hosts?

May 2, 2011

I'm trying to use ssh-keyscan to get some known_host file population going on, but I have a ton of hosts I want to scan, all with multiple aliases in /etc/hosts. Is there a way to use my current /etc/hosts file to do an ssh-keyscan instead of making a special list of hosts that (from what I've read) ssh-keyscan needs?

View 2 Replies View Related

General :: Bash: Auto Input Password?

Aug 28, 2010

When I use the scp command, here is a command prompt "Input password:",Now I want to use a one line command to perform the scp command.I tested the "echo "password" | scp xxx yu@10.xxx.xxx.xxx:/", but failed.

View 2 Replies View Related

Ubuntu Networking :: Proxy Settings: Allowed Hosts Instead Of Ignored Hosts

Aug 17, 2011

Well, as many proxy applications, GNOME Network Proxy Preferences only allow to ignore hosts. What I want to do is exactly the opposite. I only want to use the proxy for few sites. Is it possible to define only the allowed hosts in any way?

PS: I know FoxyProxy add-on for Firefox does this, but 1)I don't use Firefox and 2)I want the proxy settings system wide not only for browser.

View 9 Replies View Related

OpenSUSE :: Bash Script To Auto Capture Screen

Jul 5, 2010

I need a bash script that auto captures the screen (every 30 sec) and then realize an archive with those screenshots. The script will allow me to quering by user name and date and time framing and if exists a capture archive, it will display a slideshow that presents the captures of specified time.

View 2 Replies View Related

Ubuntu :: Lpr Command- And Man -t (bash Command - Print Both Sides Of The Paper Using A Printer?

Mar 29, 2010

I just recently learned about the wonderful little lpr command- and using man -t (bash command) to beautifully print man pages for reference- but is there a way to print both sides of the paper using a printer so equipped?

View 2 Replies View Related

CentOS 5 Networking :: Can't Seem To Get The X Server To Allow Access From Clients On Other Hosts?

Jan 8, 2009

I can't seem to get the X server to allow access from clients on other hosts. (I know, not exactly a network problem, but. I made the change in /usr/share/gdm/defaults.conf to be : DisallowTCP=false

and this worked on another CentOS system, but it hasn't fixed it on this one. What other things could prevent other clients from connecting to the X server? From the local host, I get :

Warning: Tried to connect to session manager, Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed although the client DOES actually create the window and work! So, maybe this message is a clue.

From the remote host, I get : Error: Can't open display: 10.10.1.20:0.0 Which is not terribly informative. Is there a log somewhere which details why a connect request was denied? The files in /var/log/gdm are not very informative.

View 2 Replies View Related

General :: Bash Command History Update Before Execution Of Command

Jun 7, 2010

Bash's command history is great, especially it is useful when adding the history -a command to the COMMAND_PROMPT.However, I'm wondering if there is a way to log the commands to a file as soon as the Return key is pressed, e.g. before starting the command and not on completion of the command (using the COMMAND_PROMPT option would save the command once the prompt is there again).

I read about auditing programs like snoopy and session recorder like script but I thought they're already too complex for the simple question I have. I guess that deactivating that script logs all the output of the command would lead already in the right direction but isn't there a quicker way to solve that probelm?

View 1 Replies View Related

Ubuntu :: Bash Commands' Auto-complete Not Working For Some Apps?

Jan 15, 2010

I've got an annoying problem that 'man' and some other commands do not auto-complete (via TAB). e.g. typing: man rsyn (TAB, TAB, TAB, etc) will not auto-complete to 'man rsync' however, if i 'sudo -s' & then try the above, 'man' auto-completes everytime. (Directories always auto-complete successfully) My ~/.bashrc contains:

Code:

# enable bash completion in interactive shells
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion

[code]....

View 8 Replies View Related

Software :: Bash Auto Clearing Screen When Closing Application?

Mar 8, 2010

I've wondered for years how it works and how I can change it. For example, opening a document with vim, or opening a man page, and then exiting out of it will sometimes (depending on the distro) clear the screen and leave your prompt at the very top. other times, it leaves the contents of whatever you had open on-screen and your prompt is at the bottom.

View 1 Replies View Related

Networking :: Centos Cannot Ping Hosts On The Same Subnet After Change To Static Ip

Jul 26, 2011

I am using centOS 5.0. After I change from DHCP to static IP address, I cannot ping hosts on the same subnet. The error message says destination host unreachable. Before I made the changes I was able to ping and now even I change it back to DHCP I still cannot ping with the same destination host unreachable message. The centOS is running on VMware on a Windows host.

ifconfig shows

eth0 Link encap:Ethernet HWaddr 00:0C29:A1:9A:10
inet addr: 192.168.0.202 Bcast:192.168.0.255 Mask: 255.255.255.0
inet6 addr ......

After pinging 192.168.0.106 (106 is on and other host can ping it), arp -a shows ? (192.168.0.106) at <incomplete> on eth0 I tried different ways by disabling the firewall and and disabling SE protection. No Luck.

View 13 Replies View Related

Server :: CentOS Cluster Setup For Web Hosts / Data And Mail

Mar 17, 2011

I am researching the CentOS Cluster Setup. Does anyone know of a guide on this or have a thread linked that I can look at? I want to build a small cluster and then be able to add to it as it grows. Mainly I want to have web hosts, data, and mail behind it. The DNS will probably be on there own.

View 5 Replies View Related

CentOS 5 Server :: ISCSI Devices Appears As Different /dev Names On Different Hosts

May 22, 2009

I have a fairly simple iSCSI setup using two devices, but they have swapped names on different machines. running CentOs 5.3 ia64, and using iscsi-initiator-utils-6.2.0.868-0.18.el5

vm1:
[root@vm1 ~]# fdisk -l
Disk /dev/xvda: 4194 MB, 4194304000 bytes
255 heads, 63 sectors/track, 509 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

[Code].....

Any way to get iSCSI to mount the devices as consistent device names ?

View 5 Replies View Related







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