General :: Interactive Bash Script To Ask For Superuser Password?

Jan 10, 2011

This is an old question asked many times, which, however, is NEVER answered directly in any manual I've checked. So...I'm writing a bash install script (instead of a rpm or .deb package) that must be run by a normal user. change to superuser (asking for password and receiving it) and the rest of the script to be executed in the superuser mode in order to install what I mean to install.I know how `sudo ...` or `su `root"..."` or `gnome-terminal -e ...` can achieve this purpose by creating certain batch files and then give them as argument to these commands. That's NOT what I'm asking, however.I want to know how I can make the script interactively switch to superuser mode and go on running the rest of the script (can be a lot of code) in that mode. I don't mind if it oens a separate terminal window to do that; just how can that be achieved?

View 8 Replies


General :: How To Get Rid Of Superuser Password

May 19, 2010

My father put a new superuser password on my laptop, and now I cant access my computer without him putting the password in. How can I get rid of his superuser control? Can I delete or change the superuser thing.

View 4 Replies View Related

General :: How To Get A Superuser Password

Feb 8, 2011

I have a regular password and a masterpassword, but sometimes I am being asked for a superuserpassword? I have no scripting experience and a very basic idea of how linux works. I am trying to get enough of a handle on this OS, so I can use it comfortably.

View 3 Replies View Related

General :: Password Won't Allow Superuser Access?

Jul 29, 2011

I have never set up any other password, yet I'm asked for Root password and therefore locked out from superuser.This is my own personal computer at home and there is no other O/S installed.My password works for almost anything else I've needed it for so far but I can't install my printer driver, or access su, or any of its other related privileges

View 5 Replies View Related

General :: Forgot Superuser Password - Cannot Login As SU

Mar 2, 2010

We use a linux (centOS I believe) cluster for our research. My professor somehow forgot the new password he set for root, and now can't login as 'su'. What is the way (or best way) to reset the root password without damaging something. I don't know whether it's even setup for 'sudo'. What will the procedure with and without 'sudo'?

View 5 Replies View Related

General :: Non-interactive Way To Set A Password?

Aug 11, 2010

Is there a non-interactive way to change a user's passwd short of using expect? I'm using Debian.If not, then I guess I need to get this expect script working:

#!/usr/local/bin/expect -f
set username $env(UNAME)


View 2 Replies View Related

General :: Feeding Input To Interactive Programs In Bash?

Aug 30, 2010

If I have an interactive program, e.g top, which, after launch, can be fed with key strokes and changes its behavior, for example, after launching top and then pressing "1", you can see the CPU utilization per core. I was wondering if there is a programmatical way to do so, so I don't have to press "1" every time. I would think it is an easy task, but so far my attempts have failed.

View 4 Replies View Related

Ubuntu Security :: Avoid To Rewrite The Password Again And Again - Start With Superuser Permissions

Oct 16, 2010

Having to write my user password every time I want to do anything. I DO know I'm doing something risky for the system, that's why I have Linux. Is there a way to avoid to rewrite the password again and again, like start with superuser permissions?

View 2 Replies View Related

Software :: Way To Execute Bash As Interactive And Run A Command?

Jun 20, 2009

I'm trying to start bash with a command and have it interactive like this:bash -i -c "echo Welcome!"As in, execute the command and allow me to use it as an interactive shell afterwards. (I'm doing something more complicated than echoing, but this doesn't work.)I've tried this from a running gnome-terminal, from one gnome-terminal to a new one withgnome-terminal and from the Alt+F2 program launcher (with "Run in terminal" ticked).

View 6 Replies View Related

Programming :: BASH Shell Differences: Login Or Interactive

Feb 18, 2011

Intuitively I think that the Login Shell and the Interactive Shell are the same applications but have access to different environmental variables.It this true? Why is there more than one type of shell anyways? You can change users with the interactive shell, why not log on with it to?

View 10 Replies View Related

Ubuntu :: Use Sudo Without A Password For Non Interactive Login Using Plink ?

Jun 2, 2010

Before you say you shouldn't do that bla bla bla. I know why i shouldn't.

However i have a problem with running sudo commands from a non interactive command line script run using plink.

The automated script needs to use chown and give the current user ownership of some files and folders created by another user.

I can't use things like sudo -s etc as it requires that i enter a password.

I have setup public key authorization in order to login. Do i have to give the root user a password and log in as that. I would prefer not doing this but if that is the only solution i guess i'll have too.

View 4 Replies View Related

Ubuntu :: Making Interactive Command Line Apps More Friendly (bash Feature)?

May 21, 2011

I'm using a java application that runs as an interactive command line (in a terminal). My problem is that it's rather unfriendly as an interaction mode as it's minimalistic: it doesn't allow going to and fro with arrows, there's no history and so on. So I have to type all commands every time and have to retype it if I missed something at the beginning of the line, or I have to copy and paste from a txt editor. The strange thing is that I have seen the same application running on a Windows box and allowing for all the sugar. So I'm not sure if it's because of the shell script I run (as opposed to the .bat) or whether it has to do with system or profile settings in my shell.

For information, the shell script starts with:
I've replaced it with:

In hope I would have something closer to my normal terminal. The app runs but it doesn't change anything to the interactive mode. I'm rather clueless regarding sh/bash and so on. I've seen the manuals but I'm not entirely at home understanding and using their options. I know that there's a .bashrc and perhaps something like a profile somewhere, but I don't really know how to do things with these without risking messing up.

View 9 Replies View Related

General :: Use Scp In A Bash Script Without Specifying Password?

Jul 30, 2010

I am a bash newbie, and am writing a bash script that will allow transfer of files between two computers. BTW, is there a more secure alternative to scp? Currently, I am doing this manually, by using scp. The remote server always prompts me for the password, and I supply that. I want to automate this (hence the bash script). However, I dont want to supply my password in plain text (or if at all - I was under the impression that open SSL does away with passwords and uses certificates etc?).

how I can automate my current process, without explicitly displaying my password. I am running on Ubuntu 10.0.4

View 1 Replies View Related

General :: Bash: Input Password Into A Variable?

Aug 22, 2010

I'm basically setting up two sshfs mounts and I have it set up so I run one command but type my password twice.Is there an easy to way to input a password using bash and pass that variable to another process asking for a password?

View 5 Replies View Related

General :: Automating SFTP In Bash With Password?

Jul 13, 2010

I wrote a script ages ago to automate an FTP transfer. This was easy as within the script you can specify the password with password <whatever>. Now I am wanting to do a similar thing with SFTP (SSH). I know that SFTP works differently and I cannot specify the password within the script - what do I need to do on the server I am connecting to to either "trust" the host I am connecting from or to somehow specify the password for "sftp user@some_host"? It's IP address will always be the same.

View 4 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", but failed.

View 2 Replies View Related

General :: Bash Script For Doing Tape Backups - Need Root Password

Feb 14, 2011

I have a bash script that I am using for doing tape backups. The meat of the bash script is
sudo tar --totals -H pax -cvf /dev/st0 *
This all works just fine.

But of course tape functions have to be ran as root, therefore sudo, requiring the standard user to enter the root password. I would like to be in a situation where the standard user does not need (does not know) the root password. I think my solution is add that standard user.
User named dog to the sudo list.

I have reviewed the sudo man page and looked at [URL]. I am still fuzzy.
1- Will adding user 'dog' to this sudo list do what I expect meaning I can run:
sudo tar --totals -H pax -cvf /dev/st0 *
and the user is not queried for the root password
2- How do I do that? and do I make a cmd alais for only: "tar --totals -H pax -cvf /dev/st0 *"
My distro is OpenSuse.

View 17 Replies View Related

General :: File Encryption In A Bash Script Without Explicity Providing Password?

Jul 30, 2010

I want to automate the following manual process.Currently, I am encryptying a set of files using openssl as follows:Encrypt file.txt to file.out using 256-bit AES in CBC mode $ openssl enc -aes-256-cbc -salt -in file1 -out file1.enI am then prompted for a password, which is then used to encrypt the fileWhen decrypting, I type $ openssl enc -d -aes-256-cbc -infile1.enc -out fileI am then prompted for the password - which again, I manually type.I want to automate this process of en/decryption - so I need to find a way of providing openssh with the password.

My first thought is whether it is possible to read the password from a file (say)? Or is there a better way of doing this?Also, I suppose that I will have to place restriction on who can view the password file - otherwise, that defeats the whole objective of using a password. I am thinking to run the bash script as a specific user, and then give only that user read rights to the contents of that file.Is this the way its done - or is there a better way?Ofcourse all of this leads to yet another question - which is, how to run a bash script as another user - without having to type the user pwd at the terminal.

View 1 Replies View Related

General :: Change The GTK Theme For Applications Run As Superuser On KDE?

Mar 15, 2011

When I run GTK applications on KDE, they use the QtCurve theme that matches my color and font scheme as configured in the KDE System Settings application.However GTK applications run as superuser use the old default GNOME, regardless of whether I run them with kdesudo, gksudo, or sudo on a terminal. For example, here's gedit run as superuser on top, and under my normal user account on the bottom: Qt applications run with kdesudo display the default Oxygen styling but use my settings when run with sudo on a terminal. Is there any way to configure the stying GTK applications use when run as superuser on KDE?

View 1 Replies View Related

General :: Increasing MySQLD SuperUser Slots

Mar 17, 2011

In my office we sometimes have servers that hit the max_connections limit. As we sometimes have scripts that take up that 1 extra 'superuser' slot for MySQLD, we'd like to raise that. Google really hasn't turned up much on this, is there a way to raise the number of slots?

View 1 Replies View Related

General :: VIm Copy & Paste Between Apps As A Non-superuser?

Sep 13, 2011

I'm using a work computer so i don't have a root access. I've tried "+y, "*y, set clipboard=unnamed. It looks like my vim doesn't support +clipboard (version 7.0).I'm using Linux Centos 5 so fakeclips doesn't actually help (i think)It's a pain to type stuff manually from firefox to vim or other apps and vice versa.

View 3 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

General :: Making Sh Shell Interactive?

Mar 24, 2011

how can I make my sh interactive by default. That I don't have to always type --interactive everytime I log in. I want it to be always interactive. #2- how also do I turn of --posix mode parmanently ? Is there a line I need to drop somewhere or what do i do.

View 4 Replies View Related

General :: Interactive Ssh Session Through Gateway Machine

Sep 6, 2010

Possible Duplicate:Forward SSH traffic through a middle machine.I am looking to get an interactive ssh session on a remote machine, but must login via a gateway.For example, right now I do the following:

@local % ssh <user>@<gateway>
@gateway % ssh <user>@<remote>

Is it possible to achieve the same thing in a single command from my local machine? I have tried:

@local % ssh <user>@<gateway> 'ssh <user>@<remote>`

From the output i am indeed able to login, but do not get an interactive session. I took inspiration for this attempt from using ssh to run a command remotely.

View 1 Replies View Related

General :: Re-enter Interactive Mode After Ctrl-z?

Jun 14, 2011

In interactive mode (in Octave, gnuplot, R, etc.) I occasionally press Control + z by mistake. This pauses the program and kicks me back to the terminal.Is it possible to re-enter the original interactive mode (with all the stored variables)?

To reproduce:

~> octave
octave:1> a = [1:10];
octave:2> ^Z


How can I recover my session with the variable a defined?

View 2 Replies View Related

General :: Disabling Interactive Boot In Red Hat / CentOS

Feb 12, 2010

How can I disable the interactive boot up process? Also what is the pros and cons to doing this? Will this affect my being able to get to runlevel 1?

I have been googling it but not really clear on the pros/cons etc.

I am talking about a server class machine that is in a locked room, not a desktop.

I know it can be turned off in /etc/sysconfig/init # Set to anything other than 'no' to allow hotkey interactive startup... PROMPT=yes

View 4 Replies View Related

General :: Assigning A User A Non-interactive Login?

Apr 16, 2010

I am trying to assign a user account on RHEL5 Server a non-interactive login but I am not sure if this is the correct command: useradd useraccount -s /sbin/nologinAfter I issue this command, I try to log in with this account and it says the "Administrator has disabled this account" when I enter the password. Does any one know if the command above is correct?

View 2 Replies View Related

General :: Is There Interactive Firewall For Outbound Traffic On Ubuntu?

Aug 24, 2010

I wish to prevent some programs from "phoning home", and to allow other programs to access only specific web servers.Is there any way to interactively allow or decline outbound communication from individual programs on Ubuntu?

View 4 Replies View Related

General :: Rm Non-interactive Command - Delete A Directory With Its Files

Sep 28, 2010

I wanna delete a directory with its files and I wanna do that as follows: rm -r dirToDelete Unfortunately, I always get asked for EACH single file if I wanna delete this because it is write protected.... Is there a way to suppress this feedback message so that just the whole directory with its contents disappears?

View 5 Replies View Related

General :: Differences In Output Between Top In Batch And Interactive Mode?

Jul 13, 2010

I am trying to figure out why top run in batch mode outputs so many more lines than when run in interactive mode. For example:


View 2 Replies View Related

Copyrights 2005-15, All rights reserved