opcja w shell

Serwery i sieci oparte na Slackware, wszelkiego rodzaju usługi, troubleshooting.

Moderatorzy: Moderatorzy, Administratorzy

Awatar użytkownika
F.E.O.S
Użytkownik
Posty: 18
Rejestracja: 2007-12-25, 01:26
Lokalizacja: Kielce
Kontakt:

opcja w shell

Post autor: F.E.O.S »

Cześć

mam takie pytanie jak zrobić w ssh takie coś że user loguje się do na konto przez shell i na przywitanie widzi wiadomość np . cześć feos albo coś innego czy to się robi przez skrypt czy to jest ta funkcja w jakimś config'u proszę o pomoc,
Ostatnio zmieniony 2008-06-07, 14:30 przez F.E.O.S, łącznie zmieniany 1 raz.
[b]Jabber[/b] : feos@jabber.org

[b]Nie jest sztuką zainstalować Slackware ale sztuką jest go z konfigurować prawidłowo...
Slackware dla wybranych.[/b]
Awatar użytkownika
Flash
Użytkownik
Posty: 633
Rejestracja: 2004-11-09, 18:14
Lokalizacja: Myszkow
Kontakt:

Re: opcja w shell

Post autor: Flash »

Dodajesz sobie do .bashrc to co ma się wykonać przy zalogowaniu.
Awatar użytkownika
difrost
Moderator
Posty: 2802
Rejestracja: 2006-03-11, 12:31
Lokalizacja: Wrocław
Kontakt:

Re: opcja w shell

Post autor: difrost »

Opcja Banner w sshd_config. Podajesz ścieżkę do pliku, który będzie wyświetlany przy logowaniu, bez różnicy na używanego shella.

Na marginesie: zmień temat postu, bo ten zupełnie nie ma nic wspólnego z twoim pytaniem.
[url=http://bdtk.sourceforge.net][img]http://pin.if.uz.zgora.pl/~beton/bdt-ready.png[/img][/url] #337142
--------------------------------------------
"I had a letter in the post today. It said 'Gas Bill'. It sounds a tempting offer." -- Alan Cox
"Users have been trained that when a computer bluescreens and losing all of their data, it's either (a) just the way things are, or (b) it's microsoft's fault." -- Theodore Tso
Awatar użytkownika
F.E.O.S
Użytkownik
Posty: 18
Rejestracja: 2007-12-25, 01:26
Lokalizacja: Kielce
Kontakt:

Re: opcja w shell

Post autor: F.E.O.S »

difrost,

Kod: Zaznacz cały

 /etc/ssh/ nano sshd_config

# Package generated configuration file
# See the sshd(8) manpage for details

# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 768

# Logging
SyslogFacility AUTH
LogLevel INFO

# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes

RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile	%h/.ssh/authorized_keys

# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes

# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no

#MaxStartups 10:30:60
#Banner /etc/issue.net

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

Subsystem sftp /usr/lib/openssh/sftp-server

UsePAM yes
w którym miejscu w stawić ten plik on może być txt
[b]Jabber[/b] : feos@jabber.org

[b]Nie jest sztuką zainstalować Slackware ale sztuką jest go z konfigurować prawidłowo...
Slackware dla wybranych.[/b]
largo3
Moderator
Posty: 1302
Rejestracja: 2006-06-11, 11:08

Re: opcja w shell

Post autor: largo3 »

F.E.O.S pisze:

Kod: Zaznacz cały

#Banner /etc/issue.net
Odkomentuj i podaj scieżkę do wybranego przez siebie pliku tekstowego...
UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity.
-- Dennis Ritchie
Linux Registered User #419452
pac
Użytkownik
Posty: 13
Rejestracja: 2008-06-24, 11:05

Re: opcja w shell

Post autor: pac »

a /etc/motd ?
h4rt
Użytkownik
Posty: 60
Rejestracja: 2007-04-22, 09:21

Re: opcja w shell

Post autor: h4rt »

TU działanie pliku banner jak widzimy pokazuje on jakis opis przed zalogwaniem sie na maszyne

Kod: Zaznacz cały

bash-3.1# ssh 127.0.0.1 -l test
                    Welcome to server.
       lalallalalla
test@127.0.0.1's password: 

a tu /etc/motd czyli juz po podaniu hasla i zalogowaniu sie na shella

Kod: Zaznacz cały

test@127.0.0.1's password: 
Witam na serwerze :) 
-------------------------------------------------
Administrator
test
test@test:~$ 
Ostatnio zmieniony 2008-06-25, 15:00 przez h4rt, łącznie zmieniany 1 raz.
ODPOWIEDZ