Il sort d’où ce shell /bin/MySecureShell ?
Si tu suis un guide particulier, cite-le nous s’il te plait, en nous précisant les opérations menées.
mysecureshell :
mysecureshell.sourceforge.net/fr/faq.html
Celui-ci date d’etch :
howtoforge.com/mysecureshell … ebian_etch
[quote]
This tutorial shows how to install MySecureShell on a Debian Etch system. MySecureShell is an SFTP server that is based on OpenSSH and can be configured in many ways, e.g. it has support for chrooting users into their homedirs or for limiting upload-/download bandwidths. MySecureShell makes SFTP available for users that do not have shell access so that these users do not have to use the insecure FTP protocol anymore.[/quote]
Deux remarques :
- sftp n’est pas ftp, sftp s’appuye sur ssh. Il suffit d’installer openssh-server sur une banale installation debian pour profiter de sftp sans avoir à installer Mysecureshell. Il convient donc de se pencher sur les réglages du serveur ssh.
- Mysecureshell est un shell qui ne te donne accès qu’à sftp. Ce n’est pas un shell plein comme /bin/bash. Tu ne peux pas mener un login. Tu ne peux pas passer de commandes bash.
Échantillon de commandes interactives de sftp :
$ man sftp
INTERACTIVE COMMANDS
Once in interactive mode, sftp understands a set of commands similar to
those of ftp(1). Commands are case insensitive. Pathnames that contain
spaces must be enclosed in quotes. Any special characters contained
within pathnames that are recognized by glob(3) must be escaped with
backslashes (‘\’).
bye Quit sftp.
cd path
Change remote directory to path.
chgrp grp path
Change group of file path to grp. path may contain glob(3) char‐
acters and may match multiple files. grp must be a numeric GID.
chmod mode path
Change permissions of file path to mode. path may contain
glob(3) characters and may match multiple files.
chown own path
Change owner of file path to own. path may contain glob(3) char‐
acters and may match multiple files. own must be a numeric UID.
df [-hi] [path]
Display usage information for the filesystem holding the current
directory (or path if specified). If the -h flag is specified,
the capacity information will be displayed using "human-readable"
suffixes. The -i flag requests display of inode information in
addition to capacity information. This command is only supported
on servers that implement the “statvfs@openssh.com” extension.
exit Quit sftp.
get [-Ppr] remote-path [local-path]
...
Pour retrouver un shell qui permette de sortir du carcan de sftp, il te suffirait de donner un shell plein comme /bin/zsh à ton utilisateur.
mysecureshell.sourceforge.net/fr … question11
[quote]
Q11: Comment faire si je veux utiliser MySecureShell juste pour la partie SFTP ?
IMPORTANT, vous devez être au courant des impacts de cette manipulation:
les utilisateurs qui auront un shell autre que /bin/MySecureShell pourront se connecter normalement via SSH
cette méthode empêche de fonctionner correctement les utilisateurs qui ont un shell /bin/MySecureShell
Suivant la version d’OpenSSH, il y a 2 moyens de procédés.
A partir de la version 4.5 d’OpenSSH, il suffit de rajouter la ligne suivante au fichier /etc/ssh/sshd_config (peut être différent suivant votre système d’exploitation) :
Subsystem sftp /bin/MySecureShell -c sftp-server
Et sinon pour les anciennes version d’OpenSSH, vous devez créer un script shell /bin/MySecureShell.sh (avec les droits 0755) avec comme contenu:
#!/bin/sh
/bin/MySecureShell -c sftp-server
il suffit de rajouter la ligne suivante au fichier /etc/ssh/sshd_config (peut être différent suivant votre système d’exploitation) :
Subsystem sftp /bin/MySecureShell.sh[/quote]