Search Results

Search found 30936 results on 1238 pages for 'login script'.

Page 12/1238 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Run script when shutting down ubuntu before the logged in user is logged out

    - by Travis
    I'm writing a script to backup some local directories on a unix machine (Ubuntu) to a samba drive. The script works fine and I've got it running at shutdown and restart using the method described at http://en.kioskea.net/faq/3348-ubuntu-executing-a-script-at-startup-and-shutdown It works by placing the backup script into the /etc/rc6.d and /etc/rc0.d directories. However there is a problem. After looking at the scripts logfile it seems to be run after the user is logged out. We are using LDAP authentication and when the user logs out, the system cannot backup to their samba share. Does anyone know of anyway to run the script before the user is logged out?

    Read the article

  • I do not understand -printf script

    - by jerzdevs
    I have taken over the responsibility of RHLE5 scripting and I've not had any training in this platform or BASH scripting. There's a script that has multiple pieces to it and I will ask only about the second piece but also show you the first, I think it will help with my question below. The first part of the script shows the output of users on a particular server: cut -d : -f 1 /etc/passwd The output will look something like: root bin joe rob other... The second script requires me to fill in each of the accounts listed from the above script and run. From what I can gather, and from my search on the man pages and other web searches, it goes out and finds the group owner of a file or directory and obviously sorts and picks out just unique records but not really sure - so that's my question, what does the below script really do? (The funny thing is, is that if I plug in each name from the output above, I'll sometimes receive a "cannot find username blah, blah, blah" message.) find username -printf %G | sort | uniq

    Read the article

  • maintain user login status in express.js

    - by chenliang
    when user login the app the username will be display in the header, this is my header.jade div#header_content input(type='text',name='search',id='globle_search') span#user_status if(req.isAuthenticated()) a(class='user_menu_btn',href='home', target='_blank' ) req.user.username a(class='user_menu_btn',href='logout') Logout else a(id='login_btn',href='login',class='user_status_btn') login run the app i get the error says ReferenceError: F:\shopping\views\includes\header.jade:4 req is not defined this is my index route: app.get('/',index.index); exports.index = function(req, res){ res.render('index', { title: 'Express' }); }; how to maintain login ststus in the heaedr? by the way am using passport to login user

    Read the article

  • Android Login - Best implementation

    - by perdian
    Hi everybody, I'm planning to implement an Android application that requires a login screen. If the user opens the activity something like this should happen: If user is logged in, goto 3 If user is not logged in open the login screen and perfom login Show my application content So, what's the "correct" way of implementing a login? Implement a StartActivity that perfoms the check if the user is logged in, implement a LoginActivity that implements the logging and an ApplicationActivity that actually implements the application logics? Implement just one Activity and handle the login by using multiple views which I show according to the application state? Are there any examples or tutorials for this scenario?

    Read the article

  • WPF Login Verification Using Active Directory

    - by psheriff
    Back in October of 2009 I created a WPF login screen (Figure 1) that just showed how to create the layout for a login screen. That one sample is probably the most downloaded sample we have. So in this blog post, I thought I would update that screen and also hook it up to show how to authenticate your user against Active Directory. Figure 1: Original WPF Login Screen I have updated not only the code behind for this login screen, but also the look and feel as shown in Figure 2. Figure 2: An Updated WPF Login Screen The UI To create the UI for this login screen you can refer to my October of 2009 blog post to see how to create the borderless window. You can then look at the sample code to see how I created the linear gradient brush for the background. There are just a few differences in this screen compared to the old version. First, I changed the key image and instead of using words for the Cancel and Login buttons, I used some icons. Secondly I added a text box to hold the Domain name that you wish to authenticate against. This text box is automatically filled in if you are connected to a network. In the Window_Loaded event procedure of the winLogin window you can retrieve the user’s domain name from the Environment.UserDomainName property. For example: txtDomain.Text = Environment.UserDomainName The ADHelper Class Instead of coding the call to authenticate the user directly in the login screen I created an ADHelper class. This will make it easier if you want to add additional AD calls in the future. The ADHelper class contains just one method at this time called AuthenticateUser. This method authenticates a user name and password against the specified domain. The login screen will gather the credentials from the user such as their user name and password, and also the domain name to authenticate against. To use this ADHelper class you will need to add a reference to the System.DirectoryServices.dll in .NET. The AuthenticateUser Method In order to authenticate a user against your Active Directory you will need to supply a valid LDAP path string to the constructor of the DirectoryEntry class. The LDAP path string will be in the format LDAP://DomainName. You will also pass in the user name and password to the constructor of the DirectoryEntry class as well. With a DirectoryEntry object populated with this LDAP path string, the user name and password you will now pass this object to the constructor of a DirectorySearcher object. You then perform the FindOne method on the DirectorySearcher object. If the DirectorySearcher object returns a SearchResult then the credentials supplied are valid. If the credentials are not valid on the Active Directory then an exception is thrown. C#public bool AuthenticateUser(string domainName, string userName,  string password){  bool ret = false;   try  {    DirectoryEntry de = new DirectoryEntry("LDAP://" + domainName,                                           userName, password);    DirectorySearcher dsearch = new DirectorySearcher(de);    SearchResult results = null;     results = dsearch.FindOne();     ret = true;  }  catch  {    ret = false;  }   return ret;} Visual Basic Public Function AuthenticateUser(ByVal domainName As String, _ ByVal userName As String, ByVal password As String) As Boolean  Dim ret As Boolean = False   Try    Dim de As New DirectoryEntry("LDAP://" & domainName, _                                 userName, password)    Dim dsearch As New DirectorySearcher(de)    Dim results As SearchResult = Nothing     results = dsearch.FindOne()     ret = True  Catch    ret = False  End Try   Return retEnd Function In the Click event procedure under the Login button you will find the following code that will validate the credentials that the user types into the login window. C#private void btnLogin_Click(object sender, RoutedEventArgs e){  ADHelper ad = new ADHelper();   if(ad.AuthenticateUser(txtDomain.Text,         txtUserName.Text, txtPassword.Password))    DialogResult = true;  else    MessageBox.Show("Unable to Authenticate Using the                      Supplied Credentials");} Visual BasicPrivate Sub btnLogin_Click(ByVal sender As Object, _ ByVal e As RoutedEventArgs)  Dim ad As New ADHelper()   If ad.AuthenticateUser(txtDomain.Text, txtUserName.Text, _                         txtPassword.Password) Then    DialogResult = True  Else    MessageBox.Show("Unable to Authenticate Using the                      Supplied Credentials")  End IfEnd Sub Displaying the Login Screen At some point when your application launches, you will need to display your login screen modally. Below is the code that you would call to display the login form (named winLogin in my sample application). This code is called from the main application form, and thus the owner of the login screen is set to “this”. You then call the ShowDialog method on the login screen to have this form displayed modally. After the user clicks on one of the two buttons you need to check to see what the DialogResult property was set to. The DialogResult property is a nullable type and thus you first need to check to see if the value has been set. C# private void DisplayLoginScreen(){  winLogin win = new winLogin();   win.Owner = this;  win.ShowDialog();  if (win.DialogResult.HasValue && win.DialogResult.Value)    MessageBox.Show("User Logged In");  else    this.Close();} Visual Basic Private Sub DisplayLoginScreen()  Dim win As New winLogin()   win.Owner = Me  win.ShowDialog()  If win.DialogResult.HasValue And win.DialogResult.Value Then    MessageBox.Show("User Logged In")  Else    Me.Close()  End IfEnd Sub Summary Creating a nice looking login screen is fairly simple to do in WPF. Using the Active Directory services from a WPF application should make your desktop programming task easier as you do not need to create your own user authentication system. I hope this article gave you some ideas on how to create a login screen in WPF. NOTE: You can download the complete sample code for this blog entry at my website: http://www.pdsa.com/downloads. Click on Tips & Tricks, then select 'WPF Login Verification Using Active Directory' from the drop down list. Good Luck with your Coding,Paul Sheriff ** SPECIAL OFFER FOR MY BLOG READERS **We frequently offer a FREE gift for readers of my blog. Visit http://www.pdsa.com/Event/Blog for your FREE gift!

    Read the article

  • Sharing the same `ssh-agent` among multiple login sessions

    - by intuited
    Is there a convenient way to ensure that all logins from a given user (ie me) use the same ssh-agent? I hacked out a script to make this work most of the time, but I suspected all along that there was some way to do it that I had just missed. Additionally, since that time there have been amazing advances in computing technology, like for example this website. So the goal here is that whenever I log in to the box, regardless of whether it's via SSH, or in a graphical session started from gdm/kdm/etc, or at a console: if my username does not currently have an ssh-agent running, one is started, the environment variables exported, and ssh-add called. otherwise, the existing agent's coordinates are exported in the login session's environment variables. This facility is especially valuable when the box in question is used as a relay point when sshing into a third box. In this case it avoids having to type in the private key's passphrase every time you ssh in and then want to, for example, do git push or something. The script given below does this mostly reliably, although it botched recently when X crashed and I then started another graphical session. There might have been other screwiness going on in that instance. Here's my bad-is-good script. I source this from my .bashrc. # ssh-agent-procure.bash # v0.6.4 # ensures that all shells sourcing this file in profile/rc scripts use the same ssh-agent. # copyright me, now; licensed under the DWTFYWT license. mkdir -p "$HOME/etc/ssh"; function ssh-procure-launch-agent { eval `ssh-agent -s -a ~/etc/ssh/ssh-agent-socket`; ssh-add; } if [ ! $SSH_AGENT_PID ]; then if [ -e ~/etc/ssh/ssh-agent-socket ] ; then SSH_AGENT_PID=`ps -fC ssh-agent |grep 'etc/ssh/ssh-agent-socket' |sed -r 's/^\S+\s+(\S+).*$/\1/'`; if [[ $SSH_AGENT_PID =~ [0-9]+ ]]; then # in this case the agent has already been launched and we are just attaching to it. ##++ It should check that this pid is actually active & belongs to an ssh instance export SSH_AGENT_PID; SSH_AUTH_SOCK=~/etc/ssh/ssh-agent-socket; export SSH_AUTH_SOCK; else # in this case there is no agent running, so the socket file is left over from a graceless agent termination. rm ~/etc/ssh/ssh-agent-socket; ssh-procure-launch-agent; fi; else ssh-procure-launch-agent; fi; fi; Please tell me there's a better way to do this. Also please don't nitpick the inconsistencies/gaffes ( eg putting var stuff in etc ); I wrote this a while ago and have since learned many things.

    Read the article

  • Free login on Windows Seven

    - by Rafael
    I have a delphi procedure to validate the user login on my system integrated with Active Directory. On Windows xP/2000 when the user use a invalid password It's OK, but on Windows seven the procedure didn't validating the username and password, then the user has a free access on the system

    Read the article

  • Xubuntu login hangs after Cancel Button click

    - by akester
    I'm running Xubuntu 12.04 (I installed using the alternative installer.) running in Virtaulbox 4.1.20 My issue is with the login screen (lightdm-gtk-greeter). It usually runs just fine, and allows users to log in and out but it will hang if the user presses the cancel button. The interface is still working (ie, shutdown menu is still available, I can switch to a different tty) but the username or password field (depending on when the button is hit) is disabled. Restarting lightdm will reset the screen, but the problem still exists. The issue is only with the cancel button. The login, session, and language buttons/menus as well as the accessibility and shutdown menu appear to work normally. I've modified some of the config files for lighdm-gtk-greeter, specifically /etc/lightdm/lighdm-gtk-greeter.conf to change the background image and /etc/lightdm/lightdm.conf to disable the user list. I did not check to see if the error existed before the changes took place. The changes have been restored the default settings but the problem persists. Here is the output of /var/log/lightdm/lightdm.log when the screen is hung: [+0.00s] DEBUG: Logging to /var/log/lightdm/lightdm.log [+0.00s] DEBUG: Starting Light Display Manager 1.2.1, UID=0 PID=2072 [+0.00s] DEBUG: Loaded configuration from /etc/lightdm/lightdm.conf [+0.00s] DEBUG: Using D-Bus name org.freedesktop.DisplayManager [+0.00s] DEBUG: Registered seat module xlocal [+0.00s] DEBUG: Registered seat module xremote [+0.00s] DEBUG: Adding default seat [+0.00s] DEBUG: Starting seat [+0.00s] DEBUG: Starting new display for greeter [+0.00s] DEBUG: Starting local X display [+0.02s] DEBUG: Using VT 7 [+0.02s] DEBUG: Activating VT 7 [+0.03s] DEBUG: Logging to /var/log/lightdm/x-0.log [+0.04s] DEBUG: Writing X server authority to /var/run/lightdm/root/:0 [+0.04s] DEBUG: Launching X Server [+0.05s] DEBUG: Launching process 2078: /usr/bin/X :0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch [+0.05s] DEBUG: Waiting for ready signal from X server :0 [+0.05s] DEBUG: Acquired bus name org.freedesktop.DisplayManager [+0.05s] DEBUG: Registering seat with bus path /org/freedesktop/DisplayManager/Seat0 [+0.28s] DEBUG: Got signal 10 from process 2078 [+0.28s] DEBUG: Got signal from X server :0 [+0.28s] DEBUG: Connecting to XServer :0 [+0.29s] DEBUG: Starting greeter [+0.29s] DEBUG: Started session 2082 with service 'lightdm', username 'lightdm' [+0.36s] DEBUG: Session 2082 authentication complete with return value 0: Success [+0.36s] DEBUG: Greeter authorized [+0.36s] DEBUG: Logging to /var/log/lightdm/x-0-greeter.log [+0.36s] DEBUG: Session 2082 running command /usr/lib/lightdm/lightdm-greeter-session /usr/sbin/lightdm-gtk-greeter [+0.58s] DEBUG: Greeter connected version=1.2.1 [+0.58s] DEBUG: Greeter connected, display is ready [+0.58s] DEBUG: New display ready, switching to it [+0.58s] DEBUG: Activating VT 7 [+1.04s] DEBUG: Greeter start authentication for andrew [+1.04s] DEBUG: Started session 2137 with service 'lightdm', username 'andrew' [+1.09s] DEBUG: Session 2137 got 1 message(s) from PAM [+1.09s] DEBUG: Prompt greeter with 1 message(s) [+17.24s] DEBUG: Cancel authentication [+17.24s] DEBUG: Session 2137: Sending SIGTERM

    Read the article

  • Remote boot and login with mac and iPhone?

    - by Moshe
    I need (free) software to login to my iMac from my iPod. TeamViewer works but the iMac puts itself to sleep. Are there any programs that can turn on my iMac remotely? Alternatively, are tere any settings that I can change to keep my iMac on at all times and ensure constant availability?

    Read the article

  • Optimize shell and awk script

    - by bryan
    I am using a combination of a shell script, awk script and a find command to perform multiple text replacements in hundreds of files. The files sizes vary between a few hundred bytes and 20 kbytes. I am looking for a way to speed up this script. I am using cygwin. The shell script - #!/bin/bash if [ $# = 0 ]; then echo "Argument expected" exit 1 fi while [ $# -ge 1 ] do if [ ! -f $1 ]; then echo "No such file as $1" exit 1 fi awk -f ~/scripts/parse.awk $1 > ${1}.$$ if [ $? != 0 ]; then echo "Something went wrong with the script" rm ${1}.$$ exit 1 fi mv ${1}.$$ $1 shift done The awk script (simplified) - #! /usr/bin/awk -f /HHH.Web/{ if ( index($0,"Email") == 0) { sub(/HHH.Web/,"HHH.Web.Email"); } printf("%s\r\n",$0); next; } The command line find . -type f | xargs ~/scripts/run_parser.sh

    Read the article

  • how to login as admin in safemode?

    - by Peter
    My sister has forgotten her password to vista, however i have installed that system so should know the admin password. However I do not know how to log in as admin. i tried to press ctrl+alt+delete twice in safemode to switch to normal login mode, but its not working. I heard that admin account is by default turned off in vista, so it might not work.

    Read the article

  • Adding FreeBSD user upon first login

    - by Halik
    Is it possible, to achieve the proposed behavior on my FreeBSD 8.2 server: New user ssh's into my server. He supplies as 'Login:' his student index number and a new, locked account is created with random password that is sent to his [email protected] mail as authentication method. After he logs in with this password, account is fully created and activated/unlocked and the user is asked/forced to change the pass for a new one.

    Read the article

  • Induce Mac graphical login from SSH

    - by Ben Alpert
    The title says it all. Is there a way to make the loginwindow process start a user session by running a command when remotely logged in via SSH as an admin on Mac OS X? When the machine is at the login window (no user is currently logged in), I want it to open up a user's session as if I had clicked on the username and entered a password. Solutions that don't involve scripting the GUI are highly preferred, but this Apple KB page may be of interest for those who go that route.

    Read the article

  • Problems login ubuntu 10.10

    - by siobhan
    I recently change my compiz settings for my cube and upon restarting my pc it first black screened, where it got stuck, on this screen the last command stated that it was checking the battery status, it was like this for hours i finally got thru to the Login screen but it will not accept the password (with i know is correct). I am a novice with Ubuntu but have read and tried everything the forums have told me to do but to no avail.... Please, please, please any help would be greatly appreciated. Many thanks.

    Read the article

  • After returning from standby mode, win7 asks for login twice

    - by Force Flow
    When a Windows 7 32-bit PC attached to a domain comes back from standby mode and has no user logged in, if I log in once, it jumps back to the login screen. If I log in for a second time, then it actually logs in. This happens on multiple PCs, and is not a hardware issue. The PCs are also free of viruses/malware, and are otherwise problem-free. Why does it do this, and is there a way to prevent this annoyance?

    Read the article

  • Run command automatically as root after login

    - by J V
    I'm using evrouter to simulate keypresses from my mouses extra buttons. It works great but I need to run the command with sudo to make it work so I can't just use my DE to handle autostart. I considered init.d but from what I've heard this only works for different stages of boot, and I need this to run as root after login. $ cat .evrouterrc "Logitech G500" "/dev/input/event4" any key/277 "XKey/0" "Logitech G500" "/dev/input/event4" any key/280 "XKey/9" "Logitech G500" "/dev/input/event4" any key/281 "XKey/8" $ sudo evrouter /dev/input/event4

    Read the article

  • Trouble making login page?

    - by Ken
    Okay, so I want to make a simple login page. I've created a register page successfully, but i can't get the login thing down. login.php: <?php session_start(); include("mainmenu.php"); $usrname = mysql_real_escape_string($_POST['usrname']); $password = md5($_POST['password']); $con = mysql_connect("localhost", "root", "g00dfor@boy"); if(!$con){ die(mysql_error()); } mysql_select_db("users", $con) or die(mysql_error()); $login = "SELECT * FROM `users` WHERE (usrname = '$usrname' AND password = '$password')"; $result = mysql_query($login); if(mysql_num_rows($result) == 1 { $_SESSION = true; header('Location: indexlogin.php'); } else { echo = "Wrong username or password." ; } ?> indexlogin.php just echoes "Login successful." What am I doing wrong? Oh, and just FYI- my database is "users" and my table is "data".

    Read the article

  • Accessing Server-Side Data from Client Script: Using Ajax Web Services, Script References, and jQuery

    Today's websites commonly exchange information between the browser and the web server using Ajax techniques. In a nutshell, the browser executes JavaScript code typically in response to the page loading or some user action. This JavaScript makes an asynchronous HTTP request to the server. The server processes this request and, perhaps, returns data that the browser can then seamlessly integrate into the web page. Typically, the information exchanged between the browser and server is serialized into JSON, an open, text-based serialization format that is both human-readable and platform independent. Adding such targeted, lightweight Ajax capabilities to your ASP.NET website requires two steps: first, you must create some mechanism on the server that accepts requests from client-side script and returns a JSON payload in response; second, you need to write JavaScript in your ASP.NET page to make an HTTP request to this service you created and to work with the returned results. This article series examines a variety of techniques for implementing such scenarios. In Part 1 we used an ASP.NET page and the JavaScriptSerializer class to create a server-side service. This service was called from the browser using the free, open-source jQuery JavaScript library. This article continues our examination of techniques for implementing lightweight Ajax scenarios in an ASP.NET website. Specifically, it examines how to create ASP.NET Ajax Web Services on the server-side and how to use both the ASP.NET Ajax Library and jQuery to consume them from the client-side. Read on to learn more! Read More >

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >