Tag Info

New answers tagged

0

It is perfectly safe to change ownership of files in /var/www, and indeed anything in that folder is yours to edit and change how you wish. For example, if user tsmith needs to be able to write to files in /var/www/myweb then it's perfectly fine to set the owner of these files to tsmith. Or if you prefer, keep the owner as root and require tsmith to sudo ...


0

If you only need to serve content (html, images, etc), there is no need to set a special ownership to the directories/files in /var/www, as long as the apache2 user (www-data) has permission to access the content. In case you need to do some more, you may need to modify the ownerships. For instance, if you need to upload files from a CMS (like WordPress, ...


0

It's not very secure to use any directories or files with root permissions (either ownership or single permissions). For static HTML files it would not be a big security problem but as soon as there are running scripts (PHP, JavaScript, any forms and so on) you can get serious problems.


0

You can move the directory from /opt to your home using comand: sudo cp -r /opt/android-studio ~/ Or to give permissions you have to use chmod: sudo chmod +w /opt/android-studio/some-file to add permissions to all dir recursive: sudo chmod +w -R /opt/android-studio/some-file Take a look on my answer http://askubuntu.com/a/638799/150504 that explain a ...


1

DO NOT EVER DO THIS, but if you did sudo rm -rf / the rm command, running as root, would happily start deleting. If it found a file, it would delete it,. If rm found a directory, it would enter the directory, delete all the files, then delete the directory. Eventually, rm will run out of files to delete, or will delete a file rm needs (like a dynamic ...


3

Take a look at http://www.cyberciti.biz/open-source/command-line-hacks/linux-run-command-as-different-user/ then just write a sh script which you chmod +x so that you can execute it then just use the script to launch the other script.


0

To create a second virtual host for your wordpress installation save the following as e.g. /etc/apache2/sites-available/wordpress.conf: <VirtualHost *:80> ServerName wordpress DocumentRoot /var/www/wordpress ErrorLog ${APACHE_LOG_DIR}/wordpress-error.log CustomLog ${APACHE_LOG_DIR}/wordpress-access.log combined <Directory ...


0

You can run command in terminal: sudo du -hs /* And check which folder takes the most.


3

Ok, Googling this, finding this U&L answer, checking its revisions history and following the quoted source in the revision #1, this happens to be an Upstart bug; the problem is that when switching to root running su the $UPSTART_SESSION environment variable is carried from the previous environment instead of being set again. After much banging my ...


0

In that context, it means nothing and should be removed. Without specifying some other user, sudo tries to become root, and so if you are already root, that is a no-op, other than creating an additional process ( for sudo itself ) which occupies some resources until the command it is running finishes.


2

The first error is because you created a user whose home directory doesn't exist. This is one of the reasons why you should always use adduser instead of useradd. As explained in man useradd: useradd is a low level utility for adding users. On Debian, administrators should usually use adduser(8) instead. One of the features of adduser is that it ...


0

After hours it's finally done! I just create new user like this : useradd -ou 0 myuser -p [#hash-password] and then I changed PermitRootLogin yes in this path : /etc/ssh/sshd_config easy as pie :)


3

Usually on Linux there is only one user root, and on Ubuntu it is deactivated. Instead it is a better idea to add all users that should have administrative privilieges to the group sudo by executing adduser username sudo as root. That allows them to execute commands as root by typing sudo command and get a root shell by sudo -i On top op that, you ...


2

Reboot the system to enter grub. Select recovery mode. Enter root shell Remount the system with read/write permissions: mount / -o rw,remount Run chown -R root:root /usr/lib. Once done, reboot.


0

It's very easy! Boot with Instalation CD (Ubuntu), and go to /media/ubuntu/(your disk Ubuntu), then execute: sudo chown root -R /usr/lib


0

Any resolutions?? Yes. Don't do that. Don't expect init=/bin/{bash,sh} to give a functional system that you can just use as normal. It doesn't. You have the burden of doing everything by hand that normally a proper system manager program would be doing for you. Don't expect shutdown, and indeed quite a few other system utilities, to work in the ...


2

If you can login as root: $ su root #enter password $ chmod 644 /usr/lib/sudo/sudoers.so If not, you'll have to startup in recovery mode, get write permission on your disk, and change the mode of that file. https://wiki.ubuntu.com/RecoveryMode $ mount -o remount,rw / $ chmod 644 /usr/lib/sudo/sudoers.so


0

Go find where all of the extra files got restored to and delete them. The fact that you have no space points to you simply restoring the files in the wrong location and so you have duplicates everywhere. For instance, if you backed up the whole system, but restored it to your home directory, then you have a copy of /bin, /usr, etc in ~/.


1

Check the file: /etc/mysql/mariadb.conf.d/mysqld.cnf verify if this line exists: plugin-load-add = auth_socket.so then go to MariaDB: sudo mysql -u root and make these modifications: MariaDB [(none)]>use mysql; MariaDB [(none)]>update user set plugin=' ' where User='root'; MariaDB [(none)]>flush privileges; MariaDB [(none)]>exit I ...


6

Open Terminal and type: sudo visudo Then scroll down to the line that reads: Defaults env_reset And change it to: Defaults env_reset,timestamp_timeout=0 You can change 0 to any values (time in minutes). Setting it to 0 will ask for your password every time and -1 will make it never ask. The default is 15 according to man sudo 8, but ...


0

Yes, it's normal. From man run-parts NAME run-parts - run scripts or programs in a directory In your case, run-parts run all scripts in the folder /etc/cron.hourly My /etc/cron.hourly is empty therefore /etc/cron.daily % ls -og /etc/cron.daily total 88 -rwxr-xr-x 1 311 Dez 29 00:15 0anacron -rwxr-xr-x 1 625 Mär 9 12:55 apache2 -rwxr-xr-x 1 ...


0

Yes, this cronjob exists by default. It runs hourly and executes the scripts in /etc/cron.hourly/ (if there are any).


2

The content of the directory /usr/lib/xorg is a little harder to replace than the single binary file /usr/bin/Xorg. You can still do it by just reinstalling packages, but it's made up of many packages, some of which won't apply to you. $ find /usr/lib/xorg -exec dpkg -S {} + | cut -d: -f1 | sed -e 's/, /\n/g' | sort -u xserver-common xserver-xorg-core ...


5

These .Trash-0 directories appear when root deletes non-root user files from a file manager. The 0 is the system $UID, which is zero for root. The directories are created any time a user deletes files belonging to another user account. So I think you use your root account to delete some stuffs in your home using File manager not terminal. And yes you can ...


1

First of all, known_hosts is not the file that you want to copy. That is just a list of all the systems that have been connected to to check if the system might have changed or a man-in-the-middle attack is being attempted. For password less connections, you need a id_rsa file in .ssh folder. You can copy the file and make sure is has the correct ...


0

I don't know how it is done in LAMP, but a pure Apache setup has a user group called www-data with write permission into /var/www. To achieve the same result, follow these steps: Create the group www-data, if not already existent (check with grep www-data /etc/group): groupadd www-data Transfer group ownership of /var/www to www-data, if not already ...


0

I've experienced this bug that made my computer runs very slow. At first I thought it's because the new ppa I've just added. But then I discover that it's a bug that has been confirmed in the launchpad: https://bugs.launchpad.net/ubuntu/vivid/+source/apt/+bug/1445239 It turns out there's a problem in the ServerState::HeaderLine() where it parses ...


0

Can't you just become root? sudo -i By switching the current user of your shell to root you can edit your files as the owner, which has the w flag set, without having any need to set any permission. Once done, just run exit to switch back to the previous user


-2

This is possible. Currently root owns the files - you can see that by the root root section. We need you to own the files, and be able to write to them Also, we want everyone else to be able to read them (otherwise that would be a boring website) but not to be able to edit (or that could be a greif website). How do we do this? There are 2 ways, the GUI ...


3

files should be "644", directories should be "755". What you want is not permissions but you want to set the files and directories to a user and group that is allowed to write files into /var/www/html/. sudo chown -R $USER:$USER /var/www/html/* would set all to your current user or if you need something like "www-data" (the default apache user) change it ...


0

I have the same problem too. And I also identified where all the disk space is going: du -hs /var/lib/apt/lists/partial 152G /var/lib/apt/lists/partial It seems that there is a bug in apt: https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1445239 And, the fix for it is manually installing apt 1.0.9.10 from here: ...


1

Running applications as the root user presents several serious security risks. This is why the root account is not enabled for log in by default, and all actions which need escalated privileges are performed via usage of sudo. You should not log in and run applications as root. Doing so gives total access to your machine, to the application you are running, ...


0

Ubuntu does not use busybox. The commands available to Recovery Mode are much the same as in other modes. Use: for i in $( echo $PATH | /usr/bin/tr ':' ' ') ; do /bin/ls -ld $i; /bin/ls -l $i; done



Top 50 recent answers are included