English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
El comando Linux su (abreviado en inglés: switch user) se utiliza para cambiar al identidad de otro usuario, además de root, se necesita ingresar la contraseña del usuario.
Permisos de uso: todos los usuarios.
su [-fmp] [-c command] [-s shell] [--help] [--version] [-] [USER [ARG]]
Descripción de los parámetros:
cuenta cambiar root y ls ejecutar, volver usuario original
su -c ls root
cuenta cambiar root y pasar -parámetro f nuevo shell ejecutar
su root -f
cuenta cambiar clsung y directorio trabajo cuenta clsung cambiar (home dir)
su - clsung
usuario cambiar
[email protected]:~$ whoami //usuario actual mostrar hnlinux [email protected]:~$ pwd //directorio actual mostrar /home/hnlinux [email protected]:~$ su root //usuario root cambiar contraseña: [email protected]:/home/hnlinux# whoami root [email protected]:/home/hnlinux# pwd /home/hnlinux
usuario cambiar, variable entorno cambiar
[email protected]:~$ whoami //usuario actual mostrar hnlinux [email protected]:~$ pwd //directorio actual mostrar /home/hnlinux [email protected]:~$ su - root //usuario root cambiar contraseña: [email protected]:/home/hnlinux# whoami root [email protected]:/home/hnlinux# pwd //directorio actual mostrar /root