Hot answers tagged

6

Your tomcat7 user has no login shell, have a look at /bin/false in the output below % grep tomcat /etc/passwd tomcat7:x:134:149::/usr/share/tomcat7:/bin/false and there is no need to switch your user. To run a command as tomcat7 use % sudo -u tomcat7 whoami tomcat7


5

From man 5 passwd: /etc/passwd contains one line for each user account, with seven fields delimited by colons (“:”). These fields are: · login name · optional encrypted password · numerical user ID · numerical group ID · user name or comment field · user home directory · optional user command interpreter The x would be the optional ...


5

Firstly, there should be zero reason to login as the tomcat7 user. There's no logical use case for this, so therefore I'm not sure why you'd try and use it. You state in your question you want to set up a virtual X server for a webapp - you don't need to login as tomcat7 to do this, though your question isn't "How can I launch a virtual X server for my ...


5

Usernames containing spaces are not allowed by default on Ubuntu, so this method should be robust: who | cut -d ' ' -f 1 | while read user; do for gid in $(id -G "$user"); do [ $gid -eq $(id -g) ] && printf '%s\n' "$user" && break; done; done | sort -u who: prints the list of currently logged in users; cut -d ' ' -f 1: prints the first ...


3

There is two types of accounts, system and regular user. System accounts belong to services and daemons, such as lightdm, dnsmasq, etc.Typically you cannot login into those accounts (although there are ways). Regular users, such as your account or other people accounts, can login and interact with the OS through shell (could be bash, ksh, mksh, csh, or ...


2

Open a file manager and click on the partition to mount it. Then, run the following command to gain full ownership of the partition and all contained files: sudo chown -R $USER:$USER /media/$USER/* or, sudo chown -R gsamaras:gsamaras "/media/gsamaras/a6cd1464-abf1-4a7b-b4a2-61f584d4cb32"


2

Looking at Andre Herman Bezerra's answer, the only problem with this is pointed out in the comments this DOES NOT restrict the user to update only (they can install/remove packages). If you want to restrict a user to be able to update only you're better off doing the following. Create a group or use the %staff group. In this example, i'm choosing to use ...


2

One simple solution is to simply add yourself to your son's primary group. For example if your username is "father" and your son's primary group is "son" (i.e. by default files are created as belonging to group "son"), then just do this to add yourself to that group: sudo gpasswd -a father son You will have to log out and back in for the change to take ...


2

Every Ubuntu release gets its own codename. For instance, Ubuntu 15.04 is called Vivid Vervet. 14.04 is called Trusty Tahr. Lucid and Karmic aren't "categories," they're version names of two different releases of Ubuntu. Lucid's full name is Lucid Lynx. It's the codename for Ubuntu 10.04, which was released in April of 2010. It's really old, and no longer ...


1

Users can be limited to their home directories by uncommenting /etc/vsftpd.conf file: chroot_local_user=YES To limit a specific list of users, allow only their home directories: chroot_list_enable=YES chroot_list_file=/etc/vsftp.chroot_list Set User HOME Directory: usermod --home /home/user username Set required permission on /home/user Restart ...


1

If by "the sudo" you mean the root user, then yes, that's exactly the location to store it.


1

I have to save the ssh key file into: /home/any_user/.ssh/ It is not true. You can store your key wherever you want, but it must be: secure place, so nobody else can read it if it is not standard location (~/.ssh/id_{rsa,dsa,ecdsa,...}, you need to tell ssh about the key. This is what we have config for. You can add line IdentityFile path/to/your/key ...


1

adduser is a Perl script, using Getopt::Long. Unless explicitly told to do so, Getopt::Long will accept single-hyphen long options, and adduser doesn't tell it do so. So, -ingroup will work just as well as --ingroup. Don't rely on this to work in the future, though.


1

#1 Back up your data! #2 Add the user with the exact same username as before. #3 You should have all your settings and files back. Alternative for geeks: #1 Backup Backup Backup your data! #2 Add this line to then end of /etc/passwd (replace [username] with your username, replace 1700 with your previous userid, and replace 1701 with your previous groupid - ...


1

You should create two users. User A: can manage certain folders. User B: can manage the rest of the folders. Change the password to root so only you know it and no one but you can change permissions. Do not give root privileges to either user and this way they will be unable to "reactive" it. There is NO way to disable root...


1

You already found out that your administrator (aka root) has all powers to control the system. This includes read and write access to all files on your computer. So from file permissions alone there is no way to prevent root from accessing files in a user's HOME. In order to prevent privacy abuse from root there are a few option only: Do not grant root ...


1

Technically , yes. At the very basic level you can use the following commands to create cmdonly user: sudo useradd cmdonly sudo passwd cmdonly Unlike adduser command (which is a Perl script by the way), useradd doesn't set up user profile or home directory in any way. What you have is the following entry in ...


1

You should reinstall the desktop package, it seems something went wrong with your installation as you say "I'm facing this problem from the start of using Ubuntu 14.04 LTS". Open a terminal and run sudo apt-get install --reinstall ubuntu-desktop sudo reboot This will reinstall the settings application.



Only top voted, non community-wiki answers of a minimum length are eligible