Ubuntu Servers :: New User Shell - Tab Completion Does Not Work
Nov 30, 2010
When I add a new user and SSH to my server as that new user, my command prompt is just a '$'. Tab completion doesn't work either. What I notice is that I get this:
Could not chdir to home directory /home/scaldwell: No such file or directory
$
Echo PS1 yields nothing. There is also nothing in /etc/skel. I didn't have to do anything special to get my initial user setup with the right prompt, and the second user has been added to the admin group as well. I have noticed that if I issue the command sudo chsh -s /bin/bash the account gets the correct prompt.
The short version: I have to manage some virtual machines using php shell_exec function, so far I cant do this because apache is run by the user www-data and virtualbox by the user vboxuserFrom what I've read so far, I've thought of 3 possible solutions: 1.- Create a script on my vboxuser that I can call from php to manage the Virtual Machines.2.- Change the apache user from www-data to vboxuser so I can manage the Virtual Machines through php 3.- Reinstall VirtualBox, this time using www-data as my user. I'm not sure if any of these will work and I'm not too sure of which would be the best solutionNow the longer more detailed version:
I have a remote server running Ubuntu 10.04.2, in that server I have set up VirtualBox so I can run several instances of WinXP to perform different tasks. Everything is setup and I can manage the virtual machines through SSH. If I want to run them as a different user than the one that created them (a user that so far only has been used to create the Virtual Machines) I have to do sudo -u vboxuser.Now, I need to create a PHP script to manage these virtual machines (I know about phpVirtualBox, but it's not what I need). If I try to run the virtual machines using shell_exec() from php, I get no answer at all (And I have tested that shell_exec is working on my server).
I try to shutdown a box running Fedora (fc12, all updates applied) remotely. From various threats I selected the following way that suits best to my needs: I edited the entry for shutdown in /etc/passwd: shutdown:x:6:0:shutdown:/sbin:/usr/bin/sudo /sbin/shutdown -h +1
Logging in from a tty with shutdown gives the desired result: The computer does the shutdown. Then I tried the same using sshd and plink: plink -t -l shutdown -pw xxx 10.0.0.123
As a result I get: Using username "shutdown". Access denied Access denied shutdown@10.0.0.123's password:
The /var/log/secure shows the following entry: Oct 2 00:40:46 rotgschirr sshd[6841]: User shutdown not allowed because shell /usr/bin/sudo /sbin/shutdown -h +1 does not exist Oct 2 00:40:46 rotgschirr sshd[6846]: input_userauth_request: invalid user shutdown Oct 2 00:40:46 rotgschirr unix_chkpwd[6847]: password check failed for user (shutdown) Oct 2 00:40:46 rotgschirr sshd[6841]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=rotgschirr.totes-gebirge user=shutdown Oct 2 00:40:48 rotgschirr sshd[6841]: Failed password for invalid user shutdown from 10.0.0.123 port 37195 ssh2 Oct 2 00:40:50 rotgschirr sshd[6846]: Connection closed by 10.0.0.123
Somehow when using ssh the shell /usr/bin/sudo /sbin/shutdown -h +1 cannot be found.
I switched to zsh, but I dislike the completion. If I have 20 files, each with a shared prefix, on pressing tab, zsh will fully complete the first file, then continue going through the list with each press of tab. If I want one near the end, I would have to press tab many times.
In bash, this was simple - press tab and I would get the prefix. If I continued typing (and pressing tab), bash would complete as far as it could be certain of. I find this behavior to be much more intuitive but prefer the other features of zsh to bash.
Is there a way to get this style of completion? Google suggested setopt bash_autolist, but this had no effect for me (and no error message was printed upon starting my shell).
how to get tab completion working with sudo in JeOS (Ubuntu Hardy) 8.04? Assuming I have the command '/usr/bin/svnadmin'. As a normal user I can type:
Code: svnad + TAB and it auto-completes as 'svnadmin'. If I type: Code: sudo svnad + TAB nothing happens. My 'echo $SHELL' is '/bin/bash'. I tried enabling the following in '/etc/bash.bashrc': Code: if [ -f /etc/bash_completion ]; then
[Code]...
auto-completes as I'd expect. I think I once read that there's some kind of configuration variable for sudo that causes it to use a 'more secure' path rather than the current path in the user's environment. I can't find any info on it though. I'm executing the commands from my home directory.
I am slowly rebuilding my network after a HDD crash that took out my primary development box. I installed Lucid Lynx and have things (mostly) working. The issue I am having has to do with file completion and history. I could set filec in my .cshrc file and it would work as it usually does (hit <TAB? key after typing in a couple of letters of a file name and BOOM the file auto-completes). For some reason, when I do the same thing, I get a literal TAB entered on the line. Also, if I attmept to utilize history (either the up-arrow from the keyboard I see ^[ instead of the last executed command(s).
Since upgrading my laptop to Squeeze, terminals (tested Gnome terminal and xterm) show simply a "$" prompt; machine, path and username are missing. What's really annoying though is that tab completion doesn't work, it inserts a tab character instead. Fooling around showed me that typing in the command "bash" brings everything back to what I'm used to. So in my dire newbiness do I ask, how do I reenable bash as the default shell for these programs?
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.
I've looked everywhere but I can't find where to change the default box for incoming mail, or am I on the wrong track. It's a nuisance having to change folders and I can't configure wastebin to empty on exit.And I can't get kmail to import from evolution. Do I have to go to the evolution storage and do it manually, and if so, how do I do that?
I am using the sudo command to log on locally as another user by the following command:
sudo -u theotheruser -s or sudo -u theotheruser sh
As I see it, this initiates a new shell with the mentioned other user.However, this doesn't load that users profile from his home directory.Is there a way to automatically read the users profile when login in with selected command? I am mostely interested in getting a working prompt when logged in.
Im trying to limit the diskspace users on the system may consume, and i found quotas (im a total linux noob). But when i try to set it, no matter what i set it to the maximus is 2 GB. Now... i need quite a lot more than that. One user should be able to use 1900 GB and the other 600 GB. How can i fix this? Im using ubuntu server 10.04.
I'm currently creating a simple sh file which will copy the contents of a certain directory to / directory. in my sh file:
Code:
cd "$DIR" for i in *.*; do sudo cp -iv "$i" "$DEST" done
but this requires user password. can i add the user password in my sh file? how? I'm trying to do this because I have an application to run the sh file and the application has no way to enter the password..
As I was researching on how to create a kiosk Ubuntu setting I came upon a suggestion to create the user with '/usr/bin/screen' shell option.Hope you all would forgive me for this noob question but what does this mean? I saw when I checked the Advance Settings Advance tab that there are a couple of possible options there, what do they mean and how will they affect the user profile I'm creating? I tried google for this and if my understanding is correct, these shells are suppose to be programmable and a scripting language for linux but I'm confused on what effect this has on the user profile I'm creating?One thing I notice though is that with the '/usr/bin/screen' option, the user account is refused of the Applications > Accessories > Terminal option.When I googled each one of the options I'm getting more confused as to the relevance of this to the user profile.
Im want to know the command to add a user with no shell access so they cannot log onto the system, but there a user on there so for example they can be part of the email server.
I have gnome-shell installed on Ubuntu 11.04, and installed gnome-tweak. When I open it and try to change the theme, however, it says the user-theme extension is not enabled. How to I fix this?
I inadvertently typed the wrong path when changing my user login shell and now every time I log in I get a message stating that it can't find the shell and boots me off the system. It will then redisplay the login prompt. I'm running Ubuntu Server x64 in VMware Workstation.
I have a big problem here.I have 2 shell windows, ne is a root shell and the other with some user account.If I change the root password in the root shell window aspasswd rootI can change it, but when I go into the user shell window, and I do "su" I cannot switch to root. Always "incorrect password".Same happen if I try to do "su <some-other-user>"This happen ONLY in shell windowws. If I try, for example, to run some administration service, like system-config-service, the root password is accepted in the prompting window.
How do I create a user account in a shell script? I know this may sound n00bish to you, but I know it's more than just mkdir-ing the home directory and subdirectories.
I have system that was cloned from another system hence the user was same in both computer. I changed the computer name - to TANU. Then I added another user - BANU. I gave admin rights to second user. Logged out the first user DON- who is now only the desktop user. Before deleting the account through users and groups - I deleted the folder DON from home folder. I restarted the comp. unable to login. I had created automatic login for both users. How to restore the folder DON while using root shell.
I have two machines running SQUEEZE, both installed and configured within the same week (not simultaneously). Both get the users info from a NIS server. In one of the machines (named "corona"), users cannot login, neither locally nor by ssh, in the other one ("xxlager") there is no problem. Both mount the users home directories by NFS. I have not found much useful info in the web. /etc/passwd, /etc/group/, /etc/shadow, are equally configured. The only difference I have found is when I use getent. Using "getent passwd isaenz" on xxlager yields:
isaenz:x:1001:1001:User Name,,,:/home/isaenz:/bin/tcsh but on corona the result is isaenz:x:1001:1001:User Name,,,:/home/isaenz: so the shell info is empty. Checking /var/log/auth.log I see a message saying: "User isaenz not allowed because shell does not exist"
But "ypmatch isaenz passwd" returns complete information for isaenz, both on xxlager and corona.
I want to run /etc/acpi/actions/blank.sh as a regular user, but it will only run as root. I am trying to setup a keyboard shortcut to run the above script without success. I can run the file blank.sh as root, but not as regular user. Basically I went to: System > Preferences > Keyboard Shortcuts, and added a shortcut to blank the screen. I used the name: Blank Screen, the command: /etc/acpi/actions/blank.sh, and the shortcut: XF86Launch1. XF86Launch1 corresponds to the extra "Access IBM" key found on my keyboard. xev confirms that pressing the "Access IBM" key gives the keycode XF86Launch1. I can launch other programs such as firefox using this method. Here is the actual file blank.sh:
The better method would be to get /etc/acpi/events/blank to accept a hotkey sequence, but this seems broken in Fedora 11. The file blank:
Code:
event=ibm/hotkey HKEY 00000080 00001001 action=/etc/acpi/actions/blank.sh acpi_listen for keys Fn+F1 reports: ibm/hotkey HKEY 00000080 00001001, but the above file is not being executed.
I heard (although I can't find any sources for proof) that the USER environment variable may not be set in a old Unix shells (maybe even some obscure shells as well). What is the probability that it won't be set?