General :: Switching Users In A Bash Script?
Mar 29, 2011
I want to execute a bash script that switches user and then executes a series of commands. None of this users have root privileges. I guess I have to edit the sudoers file to give user1 (the user executing the script) privileges to be able to log as user2 with no password prompt. I've been looking for this example but I haven't found any.
View 3 Replies
ADVERTISEMENT
Jul 15, 2011
Today I faced a very strange issue while switching to root account in a bash shell.My OS : CentOS-5.1.4
I logged in my system with account name user1 and I open the terminal and below shell opens
[user1@localhost ]$
Now when I type su and want to switch to root account , it fails
[user1@localhost ~]$ su
Password:
su: incorrect password
[user1@localhost ~]$ exit
I know the password is 123 & I m 100% sure .
View 8 Replies
View Related
Aug 11, 2010
Can't seem to use tcsh as my login shell under CentOS 5 as I used to (if I specify /bin/tcsh as my start-up shell, the windowing system doesn't come up), so am logging in under bash then switching to tcsh on top of that, but it won't allow display access from tcsh for my programs. Gives the "cannot connect to display" error that usually xhost + is the solution for, but xhost doesn't help in this case (won't even run under tcsh, says unable to open display "0.0"). $DISPLAY is set in .cshrc. Must be something simple, but can't seem to find a direction to head?
View 2 Replies
View Related
Jan 15, 2010
I have POPFile in my startup applications. I know how to automatically kill it when login out but cannot find a way to kill it if I just switch users (other than manually stopping it). It's important to kill it when using the switch users function because the new user will have access to the old user's POPFile database, have access to his email, etc, if I do not.I have a "lynx -dump http://127.0.0.1:8080/shutdown &>/dev/null" line in my /etc/gdm/PostSession/Default file that shuts down POPFile at log out. I need to do the same or something similar when switching user. Is there a way?
View 2 Replies
View Related
Jun 13, 2010
my mother woke up and came in here to get online and when I hit her name on the sign in screen its just stuck with her name on the screen So she woke up me and I hit CANCEL SIGN IN and now its stuck on CANCELING..... And its been like that for 10 min I am too scared to do ctrl alt backspace because its going to log me off of everything
View 1 Replies
View Related
Oct 15, 2010
Since upgrading from 9.10 to 10.04, the "Switch User" functionality no longer works. I had hoped that upgrading to 10.10 might resolve the issue, but no joy. I am using 32bit Ubuntu 10.10 on a Levono R51 laptop, with three users. 9.10 was installed from a LiveCD, and I have partitioned the hard drive so that OS is in the first partition, and the three home directories are in the second partition (just in case I need to do a complete re-installation from LiveCD). Most of time only one person uses the laptop, but if a second person tries to switch from the current session and log in, they are greeted with the following;
-- a black horizontal line (approx top quarter of the screen)
-- a purple background with the Ubuntu title and 5 red dots (lower 3/4 of screen) -- but no login screen
-- moving the mouse renders a white box (approx 1x1 inches) with some black marks
The original user can recover their session with Ctrl-Alt-F7, but this essentially makes the laptop only usable for one person (one active login) unless the original user logs off.
View 1 Replies
View Related
Oct 4, 2009
I have a CentOS dedicated server running ProFTP. I have created user accounts which are meant for FTP access only but the users cannot connect to the FTP unless their shell access is /bin/bash
Here is an example line that is outputted when I use this command:
This user can access the FTP fine, but he can also access SSH which I don't want to allow him to do. If I set his shell access to /bin/false then he can't connect to the FTP.
What can I use in instead of /bin/bash to allow FTP but don't allow SSH?
View 2 Replies
View Related
Jun 7, 2010
I need to figure out a bash command to list all users logged in at or after 5pm - 5pm being the specifier in the command.
Code:
Command seems to be the easiest way to display users but it specifies all users log times.
I've also fiddled with the lastlog command to no avail.
View 2 Replies
View Related
Aug 3, 2010
I have been experiencing issues when switching users since my last update; I filed a bug, but I was interested if anybody else was having the same problem:URL...In a nutshell the computer freezes temporarily during the switch user process. The longer it is running, the longer the freeze lasts. When frozen the screen is black except for a mouse pointer; but the mouse and keyboard are not responsive including the usual X command keys (Ctrl-Alt-Del, Ctrl-Alt-Bksp, Ctrl-Alt-F1, etc.).When I get the chance I am going to rollback gdm to see if that makes a difference.
View 1 Replies
View Related
Feb 28, 2010
I have an external USB drive that is NTFS. It mounts fine under my account and my wife's, but only if I fully shut-down the computer between switching. While switching users or logging out then in with a different account it will not mount the drive. I am not sure what to do... but we both access data from the same drive.
View 2 Replies
View Related
May 3, 2010
I just upgraded from 9.10 to 10.4. I am having the following problem:
When I attempt to switch from the user that I am currently logged into, to another user who is also logged in, I get a black screen.
To elaborate, here is the exact sequence of events:
Code:
- Boot ubuntu and login to user A
- Then Click on power menu (top right corner) and select: Switch from A
- I get the login screen
- I select user B and enter my password
[Code].....
I did try to change my session (at the login screen) to gnome-failsafe, xterm, even kde, but still I get the black screen.
View 9 Replies
View Related
Apr 26, 2010
I'm facing an odd issue with my Ubuntu 10.04. So, I have WLAN activated and working on my user account. Then I switch to another account on the same computer and nm-applet tray icon disappears! I have activated the option that all users may use the WLAN connection, but the tray-icon doesn't show up for other users. Only the one who logs in first sees it. Network connection is working properly, but the tray icon would be handy.
Trying to start nm-applet manually in terminal results in an error saying that nm-applet is already running (sure it is, on the first account that logged in). But is it possible to have the tray icon visible for all users?
View 1 Replies
View Related
Sep 10, 2015
I'm using Debian Stretch with Gnome and Cinnamon. My desktop computer sports an nvidia geforce 970 gpu (this may be relevant, and it is the reason I had to go with stretch.) I'm not a very experienced linux user but I get along fine.
I'm sharing my computer with my mom and whenever we have to switch users, the computer seems to shut down for 35 seconds: the screen doesn't receive signal anymore. After a new user is chosen, it takes another 35 seconds to get to her session. This is embarassing because my os runs on an ssd and everything else is nice and fast. At first I thought it may be a matter of us two not using the same window manager or not using the "default" window manager, but changing window managers didn't work.
Today I learned about the existence of /var/log/syslog and I decided to check what happened to it when I switched users. I can't post the whole log of what happens because it is too big, but I put it on pastebin : [URL] ....
I understand almost nothing of what is written here, but I saw some interesting things:
- after 35 seconds intervals where nothing is logged, there is a stall on cpu detected (lines 68, 500)
- my gpu seems to have something to do in all this
View 7 Replies
View Related
Nov 4, 2010
I have a problem where the resolution during bootup, shutdown, switching users, and the theme icons look very grainy & cheap. It might have started when I booted in failsafe graphics mode and after that, it never went away. Could be wrong about how it happened but is there a way to get out of failsafe mode? Or a way to reconfigure default, normal graphics?
View 9 Replies
View Related
Nov 23, 2010
installed Ubuntu Server Edition and I've found that my first user has a bash history and I can turn on a coloured prompt by editing my .bashrc etc but new users don't have that!I did : useradd -d /home/newb -m newbpasswd newband the correct looking .bashrc file appears to be in /home/newb but it is being ignore by bash when logged in as newb. Instead I am presented with just a dollar prompt instead of "newb@server"how can I sort out my users with proper prompts?
View 1 Replies
View Related
Oct 17, 2010
I have started using Ubuntu and I have to add a large number of users, over
a thousand, using a Bash Script. I also have to give them a password. Do you create a text file first.
View 1 Replies
View Related
May 14, 2009
I was asked to list passwordless or locked accounts in a fedora system. As far as I know, fedora or RH dont allow passwordless accounts (the system locks the account Edit: ... unless you set passwd -d :-P ), so I might show info about locked accounts.
I am totally aware that I could do a grep or an awk searching for "!!" or "", but my people is asking me to check against passwd -S (which prints info of accounts). The thing, is that in Solaris you can check with passwd -a -s all the users, but in Linux I couldnt find anything similar. what approach do you reccomend for passing, say , the list of users ( like the output of awk searching only user names) to the command passwd -S one by one?
View 4 Replies
View Related
Jul 29, 2011
I've been asked to do certain jobs doing scripts in bash and perl. So this time they asked me to check which users hasn't been able to loggin. DONE with Code: lasb Now they asked me to show how many times all the users have input certain Bash Commands like
Code: Ls Cd pwd I was wondering if there was a command of something that could show me how many times those commands has been used, I already know I can see all input with Code: history Sorry I'm really new to this, been working with this for a couple of weeks, and its really interesting.
View 3 Replies
View Related
Aug 26, 2010
A Tomcat server is installed under user A. Now I am going to write a script which will start this Tomcat server. And this script can be executed from other users (from there account). And if other user run this script, the process ID should be of user A, so that user A can start or stop this process any time. This means, at the beginning of the script I have set the process ID as user A. How to do this?
View 8 Replies
View Related
Dec 19, 2010
How to created users in pureftpd and the users are stored in mysql database. I tried when i try to connect i got like this error authentication failed error
View 1 Replies
View Related
Aug 1, 2011
i have a NIS master server and 4 NIS clients. out of 4 nis clients two are acting as login servers ie users will login and do all their stuffs and the remaining two are application servers. But sometimes users login into applications servers and started doing all their developer's job. i want to allow only a limited number of users tointo this application users not all the users who are all part of the nis domain.all the systems are running RHEL 5.4 on hp's proliant x86_64 based servers. Please advice me how should i proceed? enabling ip tables is not possible in my environment.
View 1 Replies
View Related
Jan 18, 2010
When I have different people log into our ftp and browse to the same folder, some people see the files inside, some don't. all the user accounts are in the same group, which has permission to this folder. but the one user who can see the files is the owner. how can i fix it so everyone in that group who's the owner of the folder can see the files?
View 10 Replies
View Related
Oct 1, 2009
Because I was browsing around in KDE and found out that I can view other users files and they can view mine.
View 1 Replies
View Related
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
Jul 17, 2010
below are the details of my system. I have bash as my current shell, some really common commands aren't working.
Do I need to do a re-installation of bash? Or how do I install a selection of bash commands which I need? (for example a subset of [URL])
Code:
root@sdptfw:~ # uname -a
Linux sdptfw.sdpt.co.za 2.4.36 #1 Tue Jul 22 13:13:24 GMT 2008 i686 i686 i386 GNU/Linux
root@sdptfw:~ # echo $SHELL$
/bin/bash$
[Code]....
View 13 Replies
View Related
Jun 30, 2010
Im not getting able to neither add new users using command useradd nor delete existing users using command userdel. And even Im not getting able to login into any existing users except root. It was ok before. Im having this problem very recently on my linux server. Im using RHEL5.
View 9 Replies
View Related
Apr 14, 2011
how to switch to a different version of KDE without difficulty? I've never changed desktop software in the same installation of a distro before. Pursuant to [URL] , I want to try KDE Trinity (which, when I first heard of it, I didn't realize was a version of KDE) and, if I like it, replace my KDE 3.5 with it. Obviously, I can't remove KDE 3.5 completely before installing Trinity; and even if I have 3.5 and Trinity installed simultaneously (can I?), I'm guessing that only one of them will ever be available in the "session type" option at system startup.
View 9 Replies
View Related
Jan 28, 2011
How to change this sequence to, for example "Ctrl+Fn+F1" or temporarily disable it?@related: How to send Ctrl+Alt+F1 to window (to switch terminal remotely, not locally)?
View 1 Replies
View Related
Mar 2, 2010
i use open suse ,while using konqueror i would like to use ctrl+tab to switch b/n two tabs as in browser , what has to be done to get that .
View 7 Replies
View Related
Dec 21, 2010
I'm currently running a Vista machine, but would like to switch over to Linux, Ubuntu in particular. My question is can I switch over to Ubuntu, keep my Windows partition and use VirtualBox to access the pre-existing Windows partition? Or does VirtualBox require me to create a new install for Guest operating systems?
If not, are there any other free alternatives to accomplish this?
View 3 Replies
View Related