A.L wrote:
Piki,
Thank a lot for your reply which is writed to be very understable for a newbie* like me with Debian.
I spend a day yesterday to read docs online and your answer is very well done.
I created a user Webmaster and ssh key ( in my case i often use scp to read files), so i can connect myself with the key and paraphrase.
May I put only PasswordAuthentication== NO, to block root acces ?
Are you talking about in your /etc/ssh/ssd_config? That will prevent people from trying to log in with a password. If you
do not set up your ssh keys with root, then yes, that will prevent root login since you would need a key to log in as root. By the way, the correct line would look like:
Code:
PasswordAuthentication no
You do not need the "==", and no should be in lower case.
Quote:
Can you tell me where are the files ( i often use winscp to read files to check the conf). Can you make me a full command example. I'm just afraid to do a big mistake and lock my linode
Which files do you mean? For ssh? They are in /etc/ssh/, and the ssh daemon that keeps running so you can use ssh it /etc/ssh/sshd_config.
The command for copying files is cp:
Code:
cp /some/directory/some/file /some/other/directory/
cp /some/directory/some/file /some/directory/new/file/name
cp -r /some/directory/ /some/other/directory
You'll need to adjust those lines with what they say. The first line will copy a file from one directory to another. The second file will give you two copies of the same file, and the new copy will have a new name. The third line, with the '-r', will let you copy a whole directory instead of a file. For moving:
Code:
mv /some/file /some/other/file
mv /some/directory /some/other/directory
For mv, you
don't need '-r' for directories. You can use it to move files and directories, or just to rename them (move /directory/a to /directory/b and get rid of /directory/a). If you want to edit a file:
Code:
nano /some/file
nano is a command line text editor. There are others, such as vi (or vim) and emacs. I've never used emacs, but I have used vi, and between vi and nano, I think nano is more newbie-friendly because it displays commands at the bottom of the screen. It will have things like "^O WriteOut" (save the file) and "^X Exit". The ^ means CTRL, so "^O" means CTRL+O.
Quote:
-----------------------------------------------
an other small request ? I read a thing yesterday ( don't rememeber where) but the tips was to put XX second between wrong password. Is it a good way to block attack ? Is it a good way to prevent a charge on the server ?
-----------------------------------------------
I don't understand what you're talking about.
Quote:
Drupal 7 has a system to upload modules, and put a warning to prevent that password is not encrypted... So my idea was for this reason to add a spécific user with limited right, but il will probably install ssl...So forgot this point.
--------------------------------------------------
What you can do is use the sudo idea in my last post to give your normal user the ability to use the cp and chown command. So what you would do is put your modules in the home directory for your user, so assuming you log in as user joe, the home directory would be "/home/joe/". Then you would unpack the module using either:
Code:
unzip /home/joe/drupal_module.zip
tar zxvf /home/joe/drupal_module.tar.gz
tar jxvf /home/joe/drupal_module.tar.bz2
depending on which type of file you have. The tar command will use 'zxvf" for .tar.gz and "jxvf" for tar.bz2; it doesn't matter what order the letters are in, just make sure it's not "-zxvf" or "-jxvf" (tar is one of the few commands that doesn't use a "-" to indicate an option).
After you unpack the modules, you'll need to copy the files that are unpacked to Drupal then change the ownership to whichever user and group that your web server uses (Debian normally makes this user and group both www-data):
Code:
cp -r /home/joe/module /srv/www/siteone/sites/all/modules
chown -R www-data:www-data /srv/www/siteone
Of course, you'll need to adjust every one of thos commands I'm giving for your user name and for where your site is actually stored. You'll also need to have the "-r" lower case for cp and the "-R" upper case for chown (I don't know why that is, but that's the way you need to do it).
You'll also see the www-data:www-data in the chown command. You can do that if you need to change the user and group at the same time. You put the user first and the group second. So if you want it to be owned by the webmaster user and the www-data group, you'd put:
Code:
chown -R webmaster:www-data /srv/www/siteone
The final thing you'll need to learn about with permissions are about read, write, and execute permissions. Those are changed with the chmod command. The chmod can be used like:
Code:
chmod u=rwx /srv/www/siteone/index.php
chmod -R g+rwx /srv/www/siteone
chmod -R o-rwx /srv/www/siteone
chmod -R 770 /srv/www/siteone
You can indicate read, write, and execute with the letters rwx, and user, group, and others (others meaning not the user or the group that owns it) with ugo or specify user group and others all at the same time with a (chmod a=rwx /srv/www/siteone). You can also use numbers to mean r, w, and x:
Code:
0 = no permission
1 = execute
2 = write
4 = read
You will need to add those together for your permissions, so read (4) and write (2) will give you 6. You'll put three numbers in a row if you use chmod - the first number sets the permission for the user that owns the file, the second number for the group that owns the file, and the third for everybody else.[/code]